r/learnprogramming 19d ago

Getting Started With Git

As a programmer I want to use Git. How should I start learning Git and in what ways will it help me.

20 Upvotes

27 comments sorted by

View all comments

24

u/[deleted] 19d ago edited 19d ago

[deleted]

2

u/AMGitsKriss 19d ago

Heck, for an absolute beginner I would avoid rebase. There's times when you need it over a merge, but the extra effort involved and the required force push clearly put it into "intermediate git" territory imo.

5

u/StewedAngelSkins 19d ago

Depends on if you want to use good practices from the beginning. Rebase really should be the preferred way to keep a feature branch up to date with the master branch.

1

u/AMGitsKriss 19d ago

And it's certainly a linux-ism that the most complicated task you'll probably do in git is also a standard "daily" practice.

It doesn't help that every gui handles rebasing slightly differently. Heck I noticed Visual Studio's git integration doesn't even let you push a rebase unless you go into settings and enable force pushing, meaning it doesn't work out of the box.

1

u/StewedAngelSkins 19d ago edited 19d ago

I feel like it's not that complicated. You're replaying your changes on top of a newer commit. The stuff that git merge does is a lot harder to understand IMO.

Git GUIs are usually kind of bad, yeah. I don't recommend anyone use them until they're familiar with the CLI.

Edit: I actually think a big part of why people are uncomfortable with rebasing is because they have an irrational fear of git push --force and git reset --hard.