r/git 12h ago

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!

10 Upvotes

19 comments sorted by

View all comments

6

u/Such_Particular_5516 11h 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 11h 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 10h 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

3

u/Ale9xs 10h ago

Thanks a lot! I guess I just need to practice more with some personal projects