我在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) 这是一个场景:
我们有一个默认的分支母版,我们以此为基础进行工作,创建分支并上推等。
现在,我们已经在Master之外创建了一个Develop分支,并将其设置为默认开发分支。
我想知道的是,现在我怎么知道我的git pull命令是否正在通过命令行从默认分支请求更改?或指向这个新的默认分支?
我做了什么:-自从创建新的默认分支git以来,我就从origin / master引入了我的master
另外,任何neww分支都来自Master还是Develop?
如你看到的
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
PS C:\Users\dir\Documents\GitHub\repo> git log
commit 867cxx
fd956f73dc91d0022b (HEAD -> master, origin/master, origin/develop, origin/HEAD)
Run Code Online (Sandbox Code Playgroud)
更新: 默认分支的此更改在克隆存储库后发生。