我要执行一段时间前为github项目所做的叉子的更新。当我试图查看远程存储库时,我看到了以下内容:
me@Bedrock:~/Downloads/git_proj/git_proj$ git remote show origin
* remote origin
Fetch URL: https://github.com/jsmith/git_proj.git
Push URL: https://github.com/jsmith/git_proj.git
HEAD branch: master
Remote branches:
api-consistency new (next fetch will store in remotes/origin)
gp-1 tracked
gp-2 new (next fetch will store in remotes/origin)
master tracked
refs/remotes/origin/new_conv_ops stale (use 'git remote prune' to remove)
revert-6817-getfullargspec new (next fetch will store in remotes/origin)
tf-gp new (next fetch will store in remotes/origin)
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (local out of date)我不明白为什么会显示多个分支被跟踪。我不是应该只跟踪主人的分支吗?如果是这样的话,为什么gp-1分支显示为被跟踪?这是不是意味着如果我想的话我可以追踪这个分支?
我是否正确地认为我的本地主分支将从远程主分支推送/拉出,但是如果我愿意,我可以让其他本地分支从任意的远程分支推拉吗?
发布于 2017-07-31 05:18:38
使用遥控器的Git文档很好地解释了您的输出。要在这里重复输出,请执行以下操作:
HEAD branch: master
Remote branches:
api-consistency new (next fetch will store in remotes/origin)
gp-1 tracked
gp-2 new (next fetch will store in remotes/origin)
master tracked
refs/remotes/origin/new_conv_ops stale (use 'git remote prune' to remove)
revert-6817-getfullargspec new (next fetch will store in remotes/origin)
tf-gp new (next fetch will store in remotes/origin)被标记为tracked的分支,例如gp-1,是那些存在于远程并且您已经在本地拉过的分支。另一方面,标记为new的分支意味着它们存在于远程上,但您尚未在本地拥有它们。
此外,被标记为master的HEAD分支意味着master是某些操作(如git pull )的默认分支。如果在本地发出git pull,但未显式指定要合并的分支,则将使用master。
发布于 2017-07-31 05:17:09
你在master分行。你所有的推和拉将做master。删除不希望使用的分支:
git branch -d <branch name>若要远程删除它们,请使用:
git push origin --delete <branch name>若要更改任何分支的推拉位置,请使用:
git branch --set-upstream <your_local_branch> <your_new_remote/branch_name>https://stackoverflow.com/questions/45407840
复制相似问题