Here's what I usually do:
$ git add . -Av
$ git commit -m "I want this to be master"
$ git branch
* (HEAD detached from f0efe1a)
Looking at the output of
git branch, it appears you're not currently on any branch (called a "detached HEAD" state).
To be on the safe side, first create a new branch (
"save-my-work") containing the commits you've created so far:
$ git branch save-my-work
Now, to include these commits in the
$ git checkout master $ git merge save-my-work
Now you should by able to push as usual. If you're sure that
master is in the state that you want it, you can delete
$ git branch -d save-my-work
Tip: Use a graphical repository viewer like
gitk to have a better overview of the state of the repository.