git使用前配置
1、git push origin <當(dāng)前分支>:refs/for/<當(dāng)前分支>,簡化為git gpush
執(zhí)行配置:
git config --global alias.gpush '!f() { : push ; r=$1; [[ -z $r ]] && r=origin; b=$2; t=$(awk "{ print \$2 }" $(git rev-parse --git-dir)/HEAD); t=${t#refs/heads/}; [[ -z $b ]] && b=$t; cmd="git push $r HEAD:refs/for/$b%topic=$t"; echo $cmd; echo; $cmd; }; f'然后
設(shè)置:
git config —local remote.origin.push ‘refs/heads/:refs/for/‘
取消
git config —unset —local remote.origin.push
?
2、自動補(bǔ)全
curl -s http://svn.baidu.com/downloads/git-completion.bash >~/.git-completion.bash source ~/.git-completion.bash3、賬號配置:
git config —global user.email liyanlei01@baidu.com (把liyanlei01badiu.com改為你的郵箱) git config —global user.name liyanlei01 (把yangyang22改為你的賬號)4、秘鑰配置:
ssh-keygen -t rsa # 一路回車選默認(rèn)選項(xiàng)之后creata或者clone一個倉庫即可操作。
轉(zhuǎn)載于:https://www.cnblogs.com/Walker-lyl/p/6806245.html
總結(jié)
- 上一篇: 乌鲁木齐新铝德源红郡是毛坯房还是精装修?
- 下一篇: 奇舞团讲座总结