unbuntu下一键配置git脚本

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hjj651471519/article/details/81026879


#!/bin/bash

username="xxx"
useremail="[email protected]"

git config --global alias.st status
echo "git status --> st "
git config --global alias.co checkout
echo "git checkout --> co "
git config --global alias.ci commit
echo "git commit --> ci "
git config --global alias.br branch
echo "git branch --> br "
git config --global alias.unstage 'reset HEAD'
echo "git reset HEAD--> unstage "

git config --global alias.last 'log -1'
echo "git log -1--> last "

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

echo "git log ------> lg"

git config --global color.ui true
echo "git ui true "


git config --global user.name $username
echo $username
git config --global user.email $useremail
echo $useremail

echo "Now ,dispaly the git config:"
git config --list 
echo "Welcome to use git-config.sh,Now you can enjoy used git"








使用方法:

将上面代码usename useremail改成你自己的然后:

touch git-config.sh

vim git-config.sh

复制上面代码

chmod 777 git-config.sh

./git-config.sh    ----(运行脚本配置git)

然后你就可以愉快的使用git了  至于配置了什么 自己看代码。





猜你喜欢

转载自blog.csdn.net/hjj651471519/article/details/81026879