fatal: You are not currently on a branch. state now, use git push master HEAD:<name-of-remote-branch> code example
Example: after checkout fatal: You are not currently on a branch.
git branch temp-branch
git checkout master
git merge temp-branch
git push origin master