git track branch with different name

前端 未结 2 1786
闹比i
闹比i 2021-02-13 00:33

I have a repo which tracks non-default branches. So, there is a local branch named \"master\" which should track \"origin/master-13.07\". I\'ve done \"push -u\", and I believe i

2条回答
  •  清歌不尽
    2021-02-13 00:49

    With Git 2.20 (Q4 2018), the advice will slightly change.

    See commit 8247166 (13 Nov 2018) by Ævar Arnfjörð Bjarmason (avar).
    (Merged by Junio C Hamano -- gitster -- in commit 2c23f0b, 01 Dec 2018)

    push: change needlessly ambiguous example in error

    Change an example push added in b55e677 ("push: introduce new push.default mode "simple"", 2012-04-24, v1.7.11-rc0) to always mean the same thing whether the current setting happens to be "simple" or not.

    This error is only emitted under "simple", but message is explaining to the user that they can get two sorts of different behaviors by these two invocations.

    Let's use:

    • "git push HEAD" which always means push the current branch name to that remote,
    • instead of "git push " which will do that under "simple", but is not guaranteed to do under "upstream".

提交回复
热议问题