Hacker News new | ask | show | jobs
by friedButter 3013 days ago
git commit -a -m "Commit" && git push

90% of the time, all you need :)

4 comments

Fixed this for you:

git commit -a -m "Commit" && git push || ( git push --force; echo "Bob, my git is weird again, could you please help?" > /run/slack/dm/bob-the-local-git-expert )

Obviously, you do this from master.

Until you actually need

git add . && git commit -m "message" && git push <remote> <branch>

Sure, but it's the 10% that hurts!
The other 10% of the time:

git commit -a -m "Commit" && git push -f

Forcing your coworkers do deal with your incompetence, I see.
Since the OP never mentioned a need to use 'git pull', I assume the 10% of the time it didn't work was when other people had gone and corrupted the repository by pushing their own commits. Clearly that's not something we want to have to deal with.