When I do a git push, I see the following:
warning: updating the currently checked out branch; this may cause confusion, as the index and working tree do not reflect changes that are now in HEAD.
I Googled for this message, and all I can find is a git mailing list discussion where the authors try to decide exactly how to make this message better to communicate to me what the real problem is.
How did I cause this, and how do I fix it?
This happens when you are pushing to a non-bare repo. A bare repo is one that consists solely of a
.gitdirectory; a non-bare repo also includes a checkout. In general, you should not push to a non-bare repo; in fact, in future version of git, that will be forbidden. If you push to a non-bare repo, then the HEAD of that repo will be out of sync with the index and the working copy.If you’re creating a repo that people are going to want to push to, then you should create it using
git init --bare(andgit init --bare --sharedif several user accounts need access to it), orgit clone --bareif you’re creating it by cloning an existing repo.