git:将本地分支与远端分支关联起来

关联起来后,可以直接切换到本地分支并执行pull命令

1.command

git config --add branch.localBranch.remote origin

git config --add branch.localBranch.merge refs/heads/remoteBranch

2.直接修改git 配置文件

.git/config

 [branch "master"]

  remote = origin

  merge = refs/heads/master

原文地址:https://www.cnblogs.com/lovemo1314/p/2850764.html