i love to make git commits. i love to stage things and then push them. i love it
you: git is really complicated, what if i push the wrong thing
me, rotating five million branches in my head: augughuguaauuhuuuuuuuuu

the spirit is weak. woe be the spirit. the body is weaker still. Siërra R
.
ask me about horses
.
i love to make git commits. i love to stage things and then push them. i love it
you: git is really complicated, what if i push the wrong thing
me, rotating five million branches in my head: augughuguaauuhuuuuuuuuu
i know only the most simplistic git commands and whenever someone tries to teach me more i unplug my computer.
someone once taught me git add -p and my brain has been irreparably broken (only ever commits singular, whole changes) ever since.
i know enough about git and how it works internally to be able to recover from most forms of screw-up and i cant tell if it's better or worse than not knowing that
My git recovery procedure is pretty air-tight:
If the code on your PC is wrong and the code on the server is correct, rm -rf your local project directory and pull a fresh copy.
If the code on your PC is correct and the code on the server is wrong, rename your local project directory, rm -rf .git, pull a fresh copy, delete everything but .git, copy everything over from the old project, and git add . to force it into sync.
Remember, kids: Always push after every commit, always pull before you start your work, and never use git commit -a because you already pushed the code and it won't push the amendment (which is something I learned the hard way multiple times).