問題很簡單:是refs/heads/master
與refs/remotes/origin/master
一樣嗎?如果不是在某些情況下,我怎麼能知道它什麼時候不是,以及它是什麼時候?Git中的「refs/heads/master」與「refs/remotes/origin/master」相同嗎?
21
A
回答
23
它們是兩個不同的符號名稱,可以指向不同的事物。 refs/heads/master
是您工作副本master
中的一個分支。通常是的refs/remotes/origin/master
一個跟蹤分支,因爲origin
是默認名稱爲遠程創建通過git clone
,其主要分支通常也稱爲master
。
你可以看到git rev-list refs/heads/master..refs/remotes/origin/master
它們之間的區別,如果它們是相同的,否則將列出它們之間的提交,這將是空的。
18
關鍵的區別理解的是,refs/heads/
下的分支是,當你有一個簽出,你可以通過創建新的提交推進分支機構。這些refs/remotes/
下,然而,所謂的「遠程跟蹤分支」 - 這些裁判只是指向提交一個遠程倉庫是在你做的git fetch <name-of-remote>
,或者成功git push
到相應的分支在遠程倉庫是最後一次。 (我寫了一篇博客文章,大約這種差異在一定長度here會談。)
相關問題
- 1. bzr send與git push相同嗎?
- 2. linux上的「git-svn clone」與mac上的「git svn clone」相同嗎?
- 3. F#List.collect與C#List.SelectMany中的相同嗎?
- 4. git-apply或git-am應該使用相同的散列嗎?
- 5. DbContext與DataContext相同嗎?
- 6. LWP與libwww-perl相同嗎?
- 7. viewInstance.undelegateEvents()與$(this.el).unbind()相同嗎?
- 8. '<?='與'echo'相同嗎?
- 9. 是480x800與800x480相同嗎?
- 10. Comparator.compareBoolean()與Comparator.compare()相同嗎?
- 11. dp與dip相同嗎?
- 12. CTRL + M與Enter相同嗎?
- 13. $ PROGRAM_NAME與$ ruby相同嗎?
- 14. Lua(Luvit)與Mongrel2相同嗎?
- 15. SOAPpy與SOAPy相同嗎?
- 16. P與P-Complete相同嗎?
- 17. com.sun.org.apache與org.apache包相同嗎?
- 18. random.random()與random.uniform()相同嗎?
- 19. URI與相對URL相同嗎?
- 20. 僅合併與GIT中特定分支相關的更改嗎?
- 21. SeDebugPrivilege()api的功能與System.Diagnostics.Process.EnterDebugMode相同嗎?
- 22. Ruby的「綁定」與Scope Chain相同嗎?
- 23. Keyrock的項目與Fiware-Service相同嗎?
- 24. getContentPane()。add()的意思與add()相同嗎?)
- 25. LISP中的關聯列表與C#中的Dictionary相同嗎?
- 26. Swift中的init與C#中的構造函數相同嗎?
- 27. Git,Mercurial和Bazaar使用相同的忽略文件安全嗎?
- 28. SQL未知與NULL相同嗎?
- 29. ReaderWriterLockSlim.EnterUpgradeableReadLock()與Monitor.Enter()基本相同嗎?
- 30. $('selector',element)與element.find('selector')相同嗎?
有人糾正我,如果我錯了,但你不應該有一個'裁判/產地/ master'的。它應該是'refs/remotes/origin/master'。 – meagar