Thread (8 messages) flat view 8 messages, 3 authors, 2016-06-15

Fatal error running status in new repo

From: Jacob Helwig <hidden>
Date: 2016-06-15 22:48:17

I just noticed this when creating a new repo for a project.


$ mkdir tmp
$ cd tmp
$ git init
Initialized empty shared Git repository in /home/jhe/projects/tmp/.git/
$ git status
# On branch master
#
# Initial commit
#
warning: ignoring dangling symref HEAD.
fatal: bad revision 'HEAD'
nothing to commit (create/copy files and use "git add" to track)
$ echo $?
0
$ git --version
git version 1.7.0


Seems a bit silly that "git status" should be issuing warnings, and
fatal errors (especially when the exit code is still 0), when run before
the first commit has been created in a brand new repository.

The warnings make sense if you know what's going on behind the scenes,
but seem like the kind of thing that could scare someone new to git when
they haven't actually done anything wrong at this point.

-- 
Jacob Helwig
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help