Re: git branch command is incompatible with bash
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jul 28, 2015, 07:28 UTC
- Message-ID
- <55B72F09.3030000@kdbg.org>
- In-Reply-To
- <xmqqh9opgtjz.fsf@gitster.dls.corp.google.com>
Am 27.07.2015 um 23:49 schrieb Junio C Hamano:
Show 12 quoted lines
> Johannes Sixt <j6t@kdbg.org> writes: > >> Try >> >> branchName=$(git rev-parse --abbrev-ref HEAD) > > Hmm, interesting. > > $ git checkout --orphan notyet > $ git rev-parse --abbrev-ref HEAD > $ git symbolic-ref --short HEAD >
Please don't scare newcomers with these corner cases ;-)
I see this:
$ git rev-parse --abbrev-ref HEAD HEAD fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' $ git symbolic-ref --short HEAD notyet
Are you trying to say that the result of 'rev-parse --abbrev-ref HEAD' is suboptimal and that of 'symbolic-ref --short HEAD' is OK?
-- Hannes