# Not currently on any branch. nothing to commit (working directory clean)

http://stackoverflow.com/questions/1745464/git-commit-problems


Short answer:

git push -u origin master

Longer answer:

You're most likely trying to push commits to a branch that wasn't created yet - for example, on a newly created Github repository without the README file automatically created. By calling git push -u origin master, you specify both the remote that you need to push to (origin, which is usually the git default) and the branch (master, also default in typical cases). According to the git documentation:

-u, --set-upstream For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch..merge in git-config(1).

你可能感兴趣的:(github)