为什么“git remote show origin”将远程分支列为“已跟踪”,即使这些分支未链接到本地分支以进行推/拉操作?在这种情况下,“跟踪”是否意味着其他事情?我认为这就是“追踪”的全部含义:git docs on branch tracking。“git remote show origin”:为什么即使有些不是,所有分支都显示“已跟踪”?
1)克隆回购与多于一个的远程分支
2)运行git remote show origin
- 说 “testBranch” 被跟踪。但git branch -vv
只能正确显示主跟踪原点/主控,而git branch -a
正确显示只有一个本地分支主控。
3)那么:git remote show origin
在将testBranch列为“已跟踪”时意味着什么?要清楚:事情的设置没有什么“错误”:一切正常。我只是不明白为什么远程testBranch被标记为“跟踪”。这就是我想要的答案。
[email protected]:~/temp/TestRepo (master)$ git remote show origin
* remote origin
Fetch URL: [email protected]:haughki/TestRepo.git
Push URL: [email protected]:haughki/TestRepo.git
HEAD branch: master
Remote branches:
master tracked
testBranch tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
[email protected]:~/temp/TestRepo (master)$ git branch -vv
* master 8df130e [origin/master] shoulda done this last time
[email protected]:~/temp/TestRepo (master)$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/testBranch
'git branch -r'告诉你什么? – gravetii 2015-02-07 04:47:40
@gravetii与'git branch -a'(见上面的输出)相同,只有本地跟踪主分支。没有本地测试分支。 – 2015-02-07 05:28:41