Having a hard time understanding git-fetch

后端 未结 4 654
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 15:43

I am having a hard time understanding the nuances of git-fetch. I understand that doing a fetch, fetches the remote refs into a local tracking branch.

I

4条回答
  •  孤街浪徒
    2020-11-22 16:08

    Note also that, with Git 2.5+ (Q2 2015), git merge FETCH_HEAD can merge multiple git fetch's.

    See commit d45366e by Junio C Hamano (gitster), 26 Mar 2015.
    (Merged by Junio C Hamano -- gitster -- in commit bcd1ecd, 19 May 2015)

    "git merge FETCH_HEAD" learned that the previous "git fetch" could be to create an Octopus merge, i.e. recording multiple branches that are not marked as "not-for-merge";
    this allows us to lose an old style invocation "git merge HEAD $commits..." in the implementation of "git pull" script; the old style syntax can now be deprecated.

    The git merge doc now mention:

    When FETCH_HEAD (and no other commit) is specified, the branches recorded in the .git/FETCH_HEAD file by the previous invocation of git fetch for merging are merged to the current branch.


    Git 2.13 (Q2 2017) officially retires the old syntax for git merge.
    See commit b439165 (26 Mar 2015) by Junio C Hamano (gitster).
    (Merged by Junio C Hamano -- gitster -- in commit 1fdbfc4, 30 Mar 2017)

    merge: drop 'git merge HEAD ' syntax

    Stop supporting "git merge HEAD " syntax that has been deprecated since October 2007, and issues a deprecation warning message since v2.5.0.

    That means the warning message old-style "'git merge HEAD ' is deprecated." is no more.

提交回复
热议问题