git branch is currently checked out

In case you created a git repository by:

git init

You might get an error below when you try to push into the remote repository:

[remote rejected] master -> master (branch is currently checked out)

The reason is that you are trying to checkin the code in already checked out repository.  You can fix it by logging into the remote repository and run command:

git config --bool core.bare true

This would enable and reset your repository as bare and will allow you to push the changes now

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.