diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2013-05-30 00:51:50 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-05-29 15:34:04 -0700 |
commit | 7b2ecd81084adeba701c60da81eec6be478910b8 (patch) | |
tree | 7fda9bb6955ec7f7898520934468dbae03b6f2c1 /Documentation/git-diff-files.txt | |
parent | push: factor out the detached HEAD error message (diff) | |
download | tgif-7b2ecd81084adeba701c60da81eec6be478910b8.tar.xz |
push: fail early with detached HEAD and current
Setting push.default to current adds the refspec "HEAD" for the
transport layer to handle. If "HEAD" doesn't resolve to a branch (and
since no refspec rhs is specified), the push fails after some time with
a cryptic error message:
$ git push
error: unable to push to unqualified destination: HEAD
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@github.com:artagnon/git'
Fail early with a nicer error message:
$ git push
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push ram HEAD:<name-of-remote-branch>
Just like in the upstream and simple cases.
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-diff-files.txt')
0 files changed, 0 insertions, 0 deletions