Live data from Hacker News

Understanding Git for real by exploring the .git directory

medium.com

41–50 of 92 posts

Re: Understanding Git for real by exploring the .git directory

#41
I wrote a series back in 2011 that looked at a bite-sized chunk each week, including how the git repository works, and although the series is long over there is a summar/index page here:

http://alblue.bandlem.com/2011/12/git-tip-of-week-finale.htm...

As a meta note; it can be really difficult to keep up a continual blog series. It helped that I advertised it in advance and then wrote around two in advance so that writers block or holidays didn't impact the schedule.

Re: Understanding Git for real by exploring the .git directory

#42
There was a very cool resource (video, ebook) on how git works on a website called peepcode. I just realised they're no longer operational. It was by Scott Chacon I think. Can't find it anywhere else now. Would have made a good addition to the resources listed here.

Re: Understanding Git for real by exploring the .git directory

#43
post #25
post #10

I worked with someone whose approach was very interesting: he committed the .git directory of a newly initialized repo to a separate, newly initialized repo. And then watched what changed when he added a file, changed things, branched, etc, in the committed .git directory. It's always seemed worthwhile to me to dig into git's model more, but if you're already comfortable and productive with stuff like detached head/r…

for about six months my git workflow was this: git add -A git commit -am "fixed some stuff" but I've finally found some time to start digging into how to really use it. The issue I have with it is that if you step outside the basics it's so easy to get yourself into a thorn bush and the way that git is explained most places is really not intuitive at all.

This is still my git workflow. Aside from the off times I have to rebase or revert a commit.

I'm curious as what git commands you've found the most valuable or you've used the most since digging deeper into git.

Re: Understanding Git for real by exploring the .git directory

#44
If this kind of approach to learning Git interests you, I took a similar approach with A Hacker's Guide To Git (https://wildlyinaccurate.com/a-hackers-guide-to-git/). It is much longer and goes into a bit more detail than the OP but (hopefully) is arranged in a way that you can read it a few sections at a time.

Re: Understanding Git for real by exploring the .git directory

#45
post #25

Earlier quoted context omitted.

for about six months my git workflow was this: git add -A git commit -am "fixed some stuff" but I've finally found some time to start digging into how to really use it. The issue I have with it is that if you step outside the basics it's so easy to get yourself into a thorn bush and the way that git is explained most places is really not intuitive at all.

This is still my git workflow. Aside from the off times I have to rebase or revert a commit. I'm curious as what git commands you've found the most valuable or you've used the most since digging deeper into git.

For some time now, we use the rebase workflow. (create your branch, do some work, rebase on master, push).

It is a great way to have a clean linear history.

But it makes git pull 'illegal' because it does a merge implicitely.

That's tipically something I didn't think about the first times I used git.

Re: Understanding Git for real by exploring the .git directory

#46

There was a very cool resource (video, ebook) on how git works on a website called peepcode. I just realised they're no longer operational. It was by Scott Chacon I think. Can't find it anywhere else now. Would have made a good addition to the resources listed here.

It seems that the old website is availible via archive.org[0], however it was part of a payment system at the time, so archive.org does not store a copy.

However, after some digging it turns out that Pluralsight put it under a Creative Commons license, so the git guide I think that you're talking about seems to be availible on Github[1].

[0]: http://web.archive.org/web/20121015074953/https://peepcode.c...

[1]: https://github.com/pluralsight/git-internals-pdf

Re: Understanding Git for real by exploring the .git directory

#47
post #45

Earlier quoted context omitted.

This is still my git workflow. Aside from the off times I have to rebase or revert a commit. I'm curious as what git commands you've found the most valuable or you've used the most since digging deeper into git.

For some time now, we use the rebase workflow. (create your branch, do some work, rebase on master, push). It is a great way to have a clean linear history. But it makes git pull 'illegal' because it does a merge implicitely. That's tipically something I didn't think about the first times I used git.

    git pull --rebase
doesn't merge implicitly and

    git config --global pull.rebase true
will set that as the default `pull` behavior.

Re: Understanding Git for real by exploring the .git directory

#48
The best way to understand Git is to learn Mercurial. It teaches you the things that matters with none of the useless implementation bullshit.

If you start with git, you won't have a clue where the interface ends and the implementation details starts. Which is why, I think, people find git hard.

I still hope that the whole development world will come to their senses and start using Mercurial more and more...

Re: Understanding Git for real by exploring the .git directory

#49
post #36

Earlier quoted context omitted.

I think most of us do agree. The official documentation is written as though the reader is already intimately familiar with the internals of git. I'm a smart guy, and I've read the official docs numerous times but every single time I failed to come away with a greater understanding than I had before. The commands are not particularly intuitive either. I personally think git is fucking awful. ... but it's the best ver…

I work in video games where everyone uses Perforce. It's not perfect but I think it's vastly superior to Git. I can train someone whose never even heard of source control how to use it in 5 minutes. Git might qualify as best FREE version control system anyone's come up with so far. But best? No, no I don't think so.

>Git might qualify as best FREE version control system...

No way it is the best. I think Mercurial easily holds the winning position for the version control with most power to weight ratio...

Post reply on HN