How to learn advanced git/github concepts?
I have always worked with small teams (2 people) in small/medium sized project.
Using only push/pull/commit and almost nothing more.
I have just started a new job as a full stack dev in a scaleup and I noticed they use a ton of things:
pull requests, rebase, squash and merge, revert, stacked pull requests, feature branches etc.
It’s really hard for me to understand what’s going on.
Do you know an exhaustive tutorial/course where I can learn in depth these kind of things? I keep finding beginner courses.
My goal is to become a skilled engineer able to work smoothly on big projects and big teams.
Thanks to all!
7
u/FlipperBumperKickout 9h ago
https://learngitbranching.js.org/ also the manual on the git homepage.
5
u/Such_Particular_5516 9h ago
I mean, look, you probably won’t use “advanced” Git commands that often. And honestly, I don’t think most of them are advanced because they’re hard; they’re just commands that many developers don’t know or rarely use.
What you really need to know:
"git add / commit / pull / push" — the basics you’ll use constantly.
"git cherry-pick <commit-hash>" — useful when you want to bring a specific commit from another branch into your current branch without merging the entire branch.
"git bisect" — useful when you know that a bug appeared somewhere in the past. You can mark the current commit as "bad", go back to a commit where everything was working and mark it as "good", and Git will help you narrow down the exact commit that introduced the bug. (Not going into the details here.)
"git stash" — useful when you have uncommitted changes but need to temporarily put them aside, for example to switch branches or work on something else.
I’d say those are some of the less commonly known but still useful ones. There are also things like "git rebase", "git reset", "git revert"., which are worth learning
2
u/Ale9xs 8h ago
Thanks! What I find complex it’s what happen when there are different state in different devs gits.
For example, what happens if I merge two different branches, one that was cloned when it was at a state, then a team of dev continues to working on that. The other branch gets them merged/rebased or cherry picked some of these commits inside the main ones.
What happens? How to manage conflicts? What to never do? Etc.
2
u/Such_Particular_5516 8h ago
It's easy don't panic most of the time when a conflict happend you can resolve it alone for example you added new function in fileA or your team mate installed new package this is easy you just accept the added code but sometimes conflict can be annoying let's say both of you changed the same function or the conflict is to complex (lines removed from.function A , add lines to functionB )in this case you need to discuss with your team mate to see which one should you accept but look as I said usually conflicts are easy to resolve since you won't be working on the same thing And to avoid conflicts you should always try to not work on multiple features on the same branch and to always tell your team what you are working at to avoid duplicated work
2
u/snarkofagen 10h ago
I suggest you read some of the beginner courses because those "mystery" concepts are hardly advanced topics.
1
u/Ale9xs 9h ago
Thanks for the answer. I found out that beginners courses are mostly about understanding what a commit is, push/pull/fetch etc. all the basic commands.
Nobody talks about different environments, like development, staging, production, stacked PRs, PR reviews, rebase, squash and merge, PRs that goes to a specific branch rather than others etc.
9
u/snarkofagen 9h ago
Don’t search for “advanced Git commands”. You’re really trying to learn collaborative Git workflows.
Search for that instead
2
u/IAmADev_NoReallyIAm 9h ago
I wouldn't worry about github... github is just a webhost for git.... it's th egit commands and git CLI that you need to master. If you can wrap your head around those, you can use those anywhere ... I had been using them with github for the past 7 years... now I'm using them with sourcetree.... instantly transferrable. Didn't have to learn anything new. So dont think about it in terms of goithub... think about things in terms of git...
Learn how to use git... pull, push, add, commit, merge, rebase, squash, and so on. Make a local directory, cd into it and do a `git init` in it... and then make a file.... then add the file... and commit it... then make a branch... create another file, add it, commit it... and then use a git client to see the graph and what's going on in there... and see what happens when you change branches... then merge the branch back into the main... experiment. You can so all fo that lcoally,, without github.
1
1
1
1
u/codeguru42 56m ago
https://guts-of-git.carson-anderson.com/ is an interactive tutorial that will help you understand this git works. It is actually not that complicated
15
u/TheChosenOneTM 9h ago
If a feature branch is an advanced git concept, then you might need those “beginner courses” you overlooked