Live data from Hacker News

Git cheat sheet [pdf]

wizardzines.com

1–10 of 146 posts

Re: Git cheat sheet [pdf]

#3
I liked the way I learned git. I started with sourcetree, a third party git gui. Super simple to use and understand. Then I moved to git gui, this step could be skipped. Then I got tired of pulling up my UIs and learned the terminal commands. Highly suggest this for anyone new, but just my (n=1) experience.

Re: Git cheat sheet [pdf]

#4
post #2

Is there a historical reason why git is needlessly complex? Seeing this cheat sheet really brings it to life.

Because Linus had more clout in the SE industry than anyone else and said “SVN bad” and nobody wanted to do enough research to disprove him so here we are.

Merging in Subversion is a complete disaster. The Subversion people kind of acknowledge this and they have a plan and their plan sucks, too. It is incredible how stupid these people are.

So for example, let's go back to one of the things where I think the designers of Subversion were complete morons. Strong opinions. That's me, right? There's a few of them in the room today, I suspect. You're stupid. (Crowd laughs)

Nobody is interest in branching. Branches are completely useless unless you merge them.

https://sandeep.ramgolam.com/blog/linus-torvalds-talks-about...

Re: Git cheat sheet [pdf]

#5
post #2

Is there a historical reason why git is needlessly complex? Seeing this cheat sheet really brings it to life.

It's not needlessly complex. The workflow it was created to support is inordinately complex, and the target market for that is highly technical, so its complexity was not the issue. Kernel developers needed to communicate to other kernel developers in a decentralized manner, and needed to work on top of each other. How do you work on a project where there are 15,000 people writing code? Git was created for this purpose.

It's as complex as it needs to be to support the workflows it was designed to be. A dumber tool would be easy to create, but then it would not be able to support more complex workflows like linux kernel development. So it's not needlessly complex, though it is more complex than it needs to be for simple use cases.

For those needing a less complicated frontend, there's a large number of them to make it easier to interact with git. For people that aren't full-time software developers, I don't recommend using git directly. However for those that are, it's worth taking the time to understand the underlying concepts so git becomes something you understand because once you do, it's quite elegant for what it does. I'm not going to gatekeep being a software developer on whether or not you know git, but if figuring out for yourself how such a fundamental system works doesn't give you a release of dopamine, this might not be your kind of thing. Which is totally fine. There are tons of things that are and aren't my thing.

I recommend https://learngitbranching.js.org for learning how to navigate around git.

but of course, https://xkcd.com/1597/ applies as well.

Re: Git cheat sheet [pdf]

#6
post #2

Is there a historical reason why git is needlessly complex? Seeing this cheat sheet really brings it to life.

I think most of the time you’d be ok just knowing a couple of git commands (log, add, commit, pull, push, ..?). And of course there’s also GUI tools.

I don’t think git is that complex for most workflows to be honest. But there is a lot of power that is available if the need arises.

Re: Git cheat sheet [pdf]

#7

I liked the way I learned git. I started with sourcetree, a third party git gui. Super simple to use and understand. Then I moved to git gui, this step could be skipped. Then I got tired of pulling up my UIs and learned the terminal commands. Highly suggest this for anyone new, but just my (n=1) experience.

All I know of git is clone, pull, commit, and push. That’s all I’ve ever needed. Git can be that simple. Of course it supports more complex uses, which you can learn if you need them.

Re: Git cheat sheet [pdf]

#8
Love this. I would add:

  git commit —-fixup $COMMIT_ID
combined with

  git rebase -i upstream/master —autosquash
These have become staples of my recent workflow. Julia’s example uses HEAD^^^^^ to rebase the previous 5 commits. I have been doing this as HEAD~5, until recently I realized you can just rebase all commits up to the upstream HEAD.

Re: Git cheat sheet [pdf]

#9
post #5
post #2

Is there a historical reason why git is needlessly complex? Seeing this cheat sheet really brings it to life.

It's not needlessly complex. The workflow it was created to support is inordinately complex, and the target market for that is highly technical, so its complexity was not the issue. Kernel developers needed to communicate to other kernel developers in a decentralized manner, and needed to work on top of each other. How do you work on a project where there are 15,000 people writing code? Git was created for this purpo…

After learning Jujutsu, I realized this is really wrong. The underlying data structures and operations are great, and they serve their purposes really well (such as supporting 10k+ people collaborating like you mentioned). They are what makes git great. The git command line interface is a needlessly complex abstraction on top of them that tries to encourage certain behaviors, but does a really bad job at it.
Post reply on HN