我知道如何创建一个跟踪远程分支的新分支,但是如何使现有分支跟踪远程分支?
我知道我可以编辑.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) 我是新手git,我在练习.我创建了一个本地分支,但是当我完成时,我看到git push我的分支没有上传到存储库.我必须这样做:git push -u origin --all.
为什么是这样?不是分支是默认推送的新变化吗?为什么我需要运行第二个命令?
我有一个名为' my_local_branch' 的本地分支,它跟踪一个远程分支origin/my_remote_branch.
现在,远程分支已经更新,我正在' my_local_branch'并且想要引入这些变化.我应该这样做:
git pull origin my_remote_branch:my_local_branch
Run Code Online (Sandbox Code Playgroud)
这是正确的方法吗?
我试图从我的heroku遥控器拉,我得到这个消息:
>git pull heroku
You asked to pull from the remote 'heroku', but did not specify
a branch. Because this is not the default configured remote
Run Code Online (Sandbox Code Playgroud)
我当地的分支机构是'开发'.
我如何从Heroku拉到我当地的分支'develop'?
谢谢.