我知道如何创建一个跟踪远程分支的新分支,但是如何使现有分支跟踪远程分支?
我知道我可以编辑.git/config文件,但似乎应该有一个更简单的方法.
我知道我可以这样做git branch --all,这向我展示了本地和远程分支,但是向我展示它们之间的关系并没有那么有用.
如何以显示哪个本地分支正在跟踪哪个远程的方式列出分支?
我有一个远程裸存储库hub.我只在master分公司工作.下面这条错误消息的最后一句让我想知道:我如何找出哪个是"当前分支的默认配置遥控器"?我该怎么设置它?
[myserver]~/progs $ git remote -v
hub ~/sitehub/progs.git/ (fetch)
hub ~/sitehub/progs.git/ (push)
[myserver]~/progs $ git branch -r
hub/master
[myserver]~/progs $ cat .git/HEAD
ref: refs/heads/master
[myserver]~/progs $ git pull hub
You asked to pull from the remote 'hub', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
Run Code Online (Sandbox Code Playgroud)