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'

 

相关文章:

  • 2021-08-13
  • 2021-10-22
  • 2022-12-23
  • 2021-09-08
  • 2021-08-28
  • 2021-06-01
  • 2022-03-09
  • 2022-01-15
猜你喜欢
  • 2021-03-27
  • 2021-10-12
  • 2021-07-08
  • 2022-12-23
相关资源
相似解决方案