Re: [PATCH] Mention that 'push .. master' is in explicit form master:refs/heads/master
- From
Jari Aalto <jari.aalto@cante.net>
- Date
- Sep 19, 2007, 10:37 UTC
- Message-ID
- <bqbzj5ze.fsf@blue.sea.net>
- In-Reply-To
- <7vfy1bvgn1.fsf@gitster.siamese.dyndns.org>
* Tue 2007-09-18 Junio C Hamano <gitster AT pobox.com> * Message-Id: 7vfy1bvgn1.fsf AT gitster.siamese.dyndns.org
Show 25 quoted lines
>> Find a ref that matches `master` in the source repository >> (most likely, it would find `refs/heads/master`), and update >> the same ref (e.g. `refs/heads/master`) in `origin` repository >> - with it. >> + with it. The following would be exactly same command: >> + >> + git push origin master:refs/heads/master > > They _might_ be exactly the same. > > The reason people often explicitly write > > $ git push $URL refs/heads/master:refs/heads/master > > in their insns for newbies is because this form would not be > affected by the random factors at $URL repository (or your > repository) and will consistently get the same result. > > $ git push $URL foo > > may push branch head 'foo' or tag 'foo' depending on which one > you have locally. Having both is not encouraged, but spelling > the insn out explicitly as refs/heads/foo makes it clear the > command is talking about the branch even when there is a tag > with the same name.
Thank you, kindly broaden the current documentation to include this explanation.
Jari
-- Welcome to FOSS revolution: we fix and modify until it shines