If git push
is rejecting your commit, there's a good reason! Read the message. Chances are it's because someone else has also pushed to master
since your last fetch. Pushing your state would throw away someone else's work. You need to fetch their changes, merge yours in, and then push the results.
git fetch
git checkout master
git merge origin/master
git push origin master