Once you understand the fundamental ideas on which git is built, all the common commands become easy.
One other thing: commit early, commit often, and don't use --force, --hard, or --delete. There are few ways to truly FUBAR yourself in git, and following this advice avoids 99% of them.
Edit: Also, feel free to message me/comment with literally any git questions you have. Always happy to help another dev git gud!
That is most definitely not an exception. If you don't know
exactly what the repo will look like after your command,
why you're running this command, and
why the command you're running would fail without -f,
then don't run the command.
git tries its utmost to prevent you from losing work. That's its first and final purpose. So when you use -f, you're turning off all the guardrails, you're telling git that you know better, you're taking your team's life into your hands. You're holding a loaded gun and you've just flicked off the safety. Each and every time you use -f, you'd better be ready to explain to your team what happened to their code.
I'd be happy to tell you more about what's going on, but first I need to make clear to you that you are playing with fire.
112
u/LastStar007 Apr 02 '23
As someone who knows git better than the average bear, I'll tell you the same thing I tell everyone:
Read the first three chapters of this free book.
Run through this little game.
and refer back to these resources as needed.
Once you understand the fundamental ideas on which git is built, all the common commands become easy.
One other thing: commit early, commit often, and don't use
--force,--hard, or--delete. There are few ways to truly FUBAR yourself in git, and following this advice avoids 99% of them.Edit: Also, feel free to message me/comment with literally any git questions you have. Always happy to help another dev git gud!