Git koans
stevelosh.com
Git koans
1–10 of 143 posts
Re: Git koans
#2Re: Git koans
#3A particular commit isn't made 'on' a branch, so to speak; it's just a SHA hash that has a particular SHA as a parent. And then a branch is a pointer to a particular SHA. So there's no way to know which branch a commit originated 'on', merely which branches happen to contain a commit at present (because their current commit has the desired commit in its history).
So, if you merge two branches together, of course you can not tell which branch a given commit originated on just by looking at history. That information was never in the history in the first place.
I could see it being useful to track this in the merge somehow, though.
Re: Git koans
#4Short of me downing distressing amounts of coffee, could someone explain these please for those of us still trying to grok git?
Re: Git koans
#5Short of me downing distressing amounts of coffee, could someone explain these please for those of us still trying to grok git?
Re: Git koans
#6Short of me downing distressing amounts of coffee, could someone explain these please for those of us still trying to grok git?
The somewhat inconsistent command line interface / option / argument parsing in git can sometimes lead to very unexpected results.
Re: Git koans
#7Re: Git koans
#8Re: Git koans
#9Has anyone made an alternative interface for git that tidies this up without drastically changing how you use git? Or would this condemn someone's sanity to the graveyard?
Re: Git koans
#10Short of me downing distressing amounts of coffee, could someone explain these please for those of us still trying to grok git?
One Thing Well demonstrates how one command (git checkout), while it does do 'one thing well' (changing your working directory to match something in the index), can handle a wide variety of seemingly unrelated use cases.
Only the Gods demonstrates how history can mean different things: commit parentage, which is usually immutable, and branch history, which is ephemeral.
The Hobgoblin probably refers to the Emerson quote "A foolish consistency is the hobgoblin of little minds."
The Long and the Short of It is about how git accepts `git --help command`, `git command --help`, and `git command -h` but `git -h command` returns an argument error.
A theme here is that git does not try to anticipate your workflow. Its commands and options are named based on what they do, rather than how you should probably use them. This makes git a very powerful tool, but with an interface that is often counter-intuitive.