News for hackers. Stuff that matters.
Re:Dangit, Git? by hangonhn on Saturday June 25, 2022 @01:34PM (#31877099)
So that’s exactly my problem and I’ve yet to come across a guide that explains the underlying concept well. Any recommendations? I often feel like I’m uttering spells without understanding it when I use git. I hate working like that. Thanks in advance!
Re:Dangit, Git? by unicornmama on Saturday June 25, 2022 @02:23PM (#31877496)
I asked myself what goes inside a commit, how git structures [e.g. connects different commits] together, why can't I tamper a commit, why are git histories tamper proof; I asked questions about what happens to the structures when I performed daily operations [fetch, merge, checkout, push -f etc.]. When I wasn't understanding merge conflicts I taught myself what git tries to do and contemplated over why you need three-way merge [e.g. instead of two way].

Some of this I was able to figure out about thinking through the problem, considering alternatives and some had to be done through reading.

My approach to learning is not so much "bottom up" [e.g. I can't just read a book from chapter 1, or some website that claims to explain everything].

Re:Dangit, Git? by mynameismon on Saturday June 25, 2022 @01:41PM (#31877148)
I've recommended it here previously, and I'll do it again, because it's so fantastic: Missing Semester's lecture on Git https://www.youtube.com/watch?v=2sjqTHE0zok
Re:Dangit, Git? by sray on Saturday June 25, 2022 @02:03PM (#31877339)
The Git book does a perfectly good job of this: https://git-scm.com/book/en/v2

I always recommended reading chapters 1-3 and skimming chapter 7 to people who are just getting started with Git.

Re:Dangit, Git? by everybodyknows on Sunday June 26, 2022 @12:16AM (#31881005)
Have a ready toolkit of general-purpose state-dumping "spells" ready at hand, to apply as soon as your tree starts to misbehave. Starter set:

  $ git-status
  $ git-log --graph --oneline --all [--reflog]
  $ git-branch -avv
  $ git-config --list
Re:Dangit, Git? by cratermoon on Saturday June 25, 2022 @02:08PM (#31877380)