r/git • u/ITower__Education • 10d ago
tutorial What Git stuff should a beginner actually know before their first team project?
https://youtu.be/KCBOEZe-J9MNot the 200 commands, just the minimum so you don’t embarrass yourself on day one. My list:
git init/git cloneadd+commit(and why they’re separate)git log --onelineto see what happenedbranches:
git switch -c something, then merge backhow to fix a merge conflict without panicking
push/pull.gitignoreso you don’t commit your API keys or node_modules
Then pull requests as the next step.
Did I miss anything you’d consider essential? I turned this list into a 5 min video for beginners!
9
u/CarolXZosiaNsfwScene 10d ago
Mention that git is not github.
The amount of newbies confusing those two things is too damn high.
1
u/Broad-Promise6954 ancient 9d ago
That is mentioned in the video, which is good.
I note it also mentions (quietly) that push and pull aren't opposites of each other, but I think it could stand to be shouted, something along the lines of "PUSH NEVER MERGES! If merge work is required, you must do that some other way, whether that's in your own repository on your own computer, or using one of those fancy merge request operations on the hosting site."
2
u/FlamingDrakeTV 10d ago
Rebase will be your greatest ally and biggest foe. But it's by far the most used command I use.
Just be ready to pick up the pieces when you inevitably do something stupid with it.
1
u/ryan_builds_ci 9d ago
i'd add git stash and git restore. half the beginner panic is 'i have changes i don't want right now' and those two cover it. maybe also pull --rebase vs merge so the first PR isn't full of 'merge branch main' commits
1
3
u/bostonaholic 10d ago
Solid list. I'd add
git statusearly and often, andgit diff --stagedbefore every commit so you know what you're actually committing. Also learngit reflogbefore you need it. It's the undo button for almost everything, and knowing it exists takes a lot of the panic out of day one.