我知道如何创建一个跟踪远程分支的新分支,但是如何使现有分支跟踪远程分支?
我知道我可以编辑.git/config
文件,但似乎应该有一个更简单的方法.
我在Git中创建了一个新分支:
git branch my_branch
Run Code Online (Sandbox Code Playgroud)
推它:
git push origin my_branch
Run Code Online (Sandbox Code Playgroud)
现在说有人在服务器上做了一些更改,我想从中拉出来origin/my_branch
.我做:
git pull
Run Code Online (Sandbox Code Playgroud)
但我得到:
You asked me to pull without telling me which branch you
want to merge with, and 'branch.my_branch.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like …
Run Code Online (Sandbox Code Playgroud)