News for hackers. Stuff that matters.
Re:I struggled with Git, so I'm making a game to spare other... by never_inline on Sunday March 02, 2025 @11:26AM (#43232041)
I use the following commands frequently

* pull

* push

* checkout / switch

* commit (ofcourse)

* merge

But I will end up needing

* log / log --stat

* stash

* diff

* show / show --stat

* blame

* revert

* cherry-pick

* reset

* git grep (can be replaced with rg / grep -rn)

I can't imagine not having these commands now.

If you use something frequently you should know it in-depth. It applies to tools (git, VSCode), frameworks (Spring, Django, whatever), infra (kubernetes, docker). otherwise you're missing out.

Re:I struggled with Git, so I'm making a game to spare other... by mlhpdx on Sunday March 02, 2025 @11:36AM (#43232137)
> If you use something frequently you should know it in-depth.

I prefer to remain oblivious to many things. Two views of the Mississippi and all that.

Git works reliably and achieves my humble expectations. Thanks git.

But in reality I use about the same set of commands. The exception being ‘cherry-pick’ which I avoid solely on disliking the name.

Re:I struggled with Git, so I'm making a game to spare other... by fragmede on Sunday March 02, 2025 @12:21PM (#43232668)
what would you call it instead? or does the word cherry have some weird association in your mind?
Re:I struggled with Git, so I'm making a game to spare other... by mlhpdx on Sunday March 02, 2025 @12:24PM (#43232701)
No, it’s just weird and out of context. Just plain “pick” maybe.
Re:I struggled with Git, so I'm making a game to spare other... by fragmede on Sunday March 02, 2025 @09:43PM (#43237748)
maybe

    git alias --global pick cherry-pick
Re:I struggled with Git, so I'm making a game to spare other... by relaxing on Sunday March 02, 2025 @02:46PM (#43234245)
cherry picking has a negative connotation in its most common usage.
Re:I struggled with Git, so I'm making a game to spare other... by fragmede on Sunday March 02, 2025 @09:43PM (#43237745)
sure but is it enough to avoid using it though? I don't like to get screwed in business, but I don't avoid the screwdriver in my toolbox when I need one.
Re:I struggled with Git, so I'm making a game to spare other... by initialcommit on Sunday March 02, 2025 @11:40AM (#43232185)
Hard agree. I love this mindset! If you put a tool in your toolbag you should know how to use it.

Git is definitely abstract and hard to get the hang of but totally worth it - pays dividends in terms of the options it puts at your disposal. And the stimulating nature of learning how it works so that you can think for yourself to figure out a solution, instead of just memorizing 3 commands and running to AI for help when you get a little stuck.

Re:I struggled with Git, so I'm making a game to spare other... by rectang on Sunday March 02, 2025 @03:33PM (#43234742)
Version control is one of our main tools for interacting with other developers. Having a rich understanding of your version control software often helps to find solutions and workarounds for problems which would otherwise result in needless conflict.
Re:I struggled with Git, so I'm making a game to spare other... by bloomingkales on Sunday March 02, 2025 @12:04PM (#43232459)
Core:

- pull

- push

- commit/checkout

- merge

Quality of life:

- stash

- diff

Asking for trouble:

- revert

- cherry-pick

Your definition matches my mine of a tight subset of git.

[dead]
Re:I struggled with Git, so I'm making a game to spare other... by fragmede on Sunday March 02, 2025 @09:47PM (#43237767)
lol not sure why this got downvoted unless it's because ~1 is redundant and you can either do HEAD^ or HEAD~ and save one keystroke
Re:I struggled with Git, so I'm making a game to spare other... by rochacon on Sunday March 02, 2025 @05:02PM (#43235667)
I would just add `git rebase -i` to the mix. Very useful to clean up a work branch before submitting it for others. Sometimes you just need a bunch of "wip" commits, e.g. testing CI scripts, deploying a optimization on the side for further testing, etc. and rebase is a must if you care about the commit log.
Re:I struggled with Git, so I'm making a game to spare other... by starsixtynine on Sunday March 02, 2025 @08:28PM (#43237339)
You forgot to include an explanation of what rebase does, which is important for knowing when to actually use it, instead of just specific goals you might have.