提问人:gerard 提问时间:12/9/2014 更新时间:12/9/2014 访问量:1929
运行 git status 时,消息“您的分支是最新的,带有'origin/branch'”仅出现几次
When running git status the message "your branch is up-to-date with 'origin/branch' only appears some times
问:
我有一个包含多个分支的存储库。所有分支都与等效的远程分支保持同步。
例如,请参阅以下两个分支的 git status 和 git log 的输出:
分行mantis_0074
mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0074)
$ git status
On branch mantis_0074
nothing to commit, working directory clean
mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0074)
$ git log --oneline --decorate
a67b6f7 (HEAD, origin/mantis_0074, mantis_0074) M-0074: Update expected results from sample bids.
afda69c M-0074: Rename long and short term intra-day BritNed auction files to use the correct name format so that they will be processed correctly (i.e. not handled as
bcc41 M-0074: Add unprocessed files which can be used for testing amp_file_transfer.ps1 script.
分行mantis_0151
mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0151)
$ git status
On branch mantis_0151
Your branch is up-to-date with 'origin/mantis_0151'.
nothing to commit, working directory clean
mchaleg@ELT-L-0018 ~/Documents/BitBucket/electroroute_repositories/gudrun (mantis_0151)
$ git log --oneline --decorate
f0487e2 (HEAD, origin/mantis_0151, mantis_0151) mantis_0151 Finalised version of trigger with updated varaible names etc
24a0ae0 mantis_0151 get the tb_apx_fact_private_trades table trigger into line with what is in production as it currently isn't. Also add the create statement as well
从 git log 输出中可以看出,这两个分支都与远程分支保持同步。
既然两个分支都是最新的,为什么消息只显示在分支mantis_0151的 git 状态消息中?Your branch is up-to-date with 'origin/branch'
答:
6赞
user229044
12/9/2014
#1
只有当你的分支设置为跟踪远程分支时,Git 才会显示此消息。您的第一个分支似乎不是。
评论
2赞
gerard
12/9/2014
这成功了。我能够使用 .我不明白的是,为什么有些分支设置为跟踪遥控器,而有些则没有。到目前为止,我还不知道如何跟踪远程分支,所以我以前没有手动完成过。git branch -u origin/branch
1赞
gerard
1/16/2015
有关如何跟踪远程分支的详细信息,请参阅使现有 Git 分支跟踪远程分支?
评论