What does git “updating currently checked out branch” warning mean?

This happens when you are pushing to a non-bare repo. A bare repo is one that consists solely of a .git directory; 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 (and git init --bare --shared if several user accounts need access to it), or git clone --bare if you’re creating it by cloning an existing repo.

Leave a Comment