DEV Community

loading...

Discussion on: Confused by git? Here's a git crash course to fix that 🎉

Collapse
evolutionxbox profile image
Jonathan Cousins

The biggest misconception I find (which I couldn’t see listed here) is that a the history is a list of changes. Instead commits are snapshots of the entire repo, not just changes.

Collapse
chrisachard profile image
Chris Achard Author

That's a good point - git is unlike SVN in that way. SVN stores diffs (which is why it can take a long time to calculate the current state when your repo history gets really long), and git stores entire files. I always had thought that git stored diffs as well (since you "commit" just the change, right?) - but nope!

I didn't include it because I find that, in practice, it doesn't matter much whether you think of the commit log as being diffs or snapshots - but I could be wrong... have you found cases where it matters a lot which way you think of it? Thanks!

Collapse
evolutionxbox profile image
Jonathan Cousins

It does when people get comfortable with cherry picking.

Thread Thread
chrisachard profile image
Chris Achard Author

Ah, good point

Thread Thread
evolutionxbox profile image
Jonathan Cousins

You have a very helpful article. I would definitely not expect someone new to git to start cherry picking.

Thread Thread
chrisachard profile image
Chris Achard Author

Thanks! Yeah; maybe on a more advanced course sometime :)