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