Git push [远程分支] [本地分支]
建立关联
Git branch --set-upstream mybranch origin/mybranch
Git push
简化git push书写
$ git gpush
简化git push HEAD:refs/for/master,命令好长,输入很麻烦,有没有更简单便捷办法(tags: gpush, refs/for)sh
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‘
原文:http://www.cnblogs.com/SapphireCastle/p/6395177.html