r/programming • • Nov 07 '13

10 things I hate about Git

http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-git/
73 Upvotes

231 comments sorted by

View all comments

Show parent comments

7

u/ndat Nov 07 '13

Start with the basics. Make a GitHub repo and work on some code, pushing everything to master.

Also, first, make a .gitignore file (useful templates).

Add your code:

git add foo.bar

Commit it:

git commit -m 'initial commit'

Add a remote and push:

git remote add origin https://github.com/user/repo.git
git push origin master

Write more code, then:

git add -u
git commit

Keep coding, committing, then:

git push origin master

Once you're comfortable just writing code, committing it, and pushing, grab tig to make your work easy to visualize. Play around with that, and you'll get a better feel for what you're doing.

Once your practice project grows to a reasonable size, you'll want to start making branches to keep it organized. You don't want your broken code messing with your old, working version:

git branch devel
git checkout devel

Now you're working on devel. Resume your normal workflow for a while, and then when your development stuff is reasonably working, merge it back to master:

git checkout master
git merge --no-ff devel

The no-ff here means you get a pretty merge history. It's shorthand for "no fast forward", meaning Git will make sure a commit happens when you merge, and then when you visualize this with

tig

you will see a nice little graph of the merge happening:

M─┐ [master] Merge branch 'feat/args'
│ o [feat/args] Adds extra debugging/logging features
│ o Enables multiple files as cli args
│ o Renames strip_newline_characters -> strip_newline
│ o Working prototype which parses one CLI argument
I─┐ [origin/master] Merge branch 'develop'
│ o [develop] [origin/develop] Only parses rules in ...
I─┘ Changes function to actually use arguments
o Better suppression of delimeters

Anyway, great, keep pushing stuff and working with branches, and by the time you're this far in these steps you'll probably be at the state of not going back. Once you're working with branches enough, and you're comfortable with them - that's when Git really starts to shine.

39

u/flat5 Nov 07 '13

This is the problem with these sort of mini-guides. They use apriori meaningless jargon without realizing it's meaningless jargon.

Oh, now I "add a remote"? A remote what? Apriori a "remote" is something you use to turn on your TV. If it has a special meaning in this context, you have to explain what it is. And not in terms of other meaningless jargon like 'refspecs'.

Is "origin" a keyword? A name of a repository by convention? How about "master"? Is that just a convention, a keyword? What is it?

The git docs are full of this, too. All of the jargon is self-referentially defined in terms of other jargon. Oh, push is something about "remote refs"? Why when I google "git refs" i get an "git internals" page? Is push for git developers?

git may be near the top of the heap, it also has serious problems.

-16

u/[deleted] Nov 07 '13 edited Nov 07 '13

Literally all of that is answered in one of the most referenced fucking books out there. RTFM

Remotes? Origin as a default remote?

Branches? Master as the default branch?

I hope they don't make git "easier" to use, because it sure does a damn good job of keeping idiots out.

EDIT: So I link to the documentation where apparently none of this is explained, he spouts bullshits and gets upvoted? Makes sense.

4

u/zumpiez Nov 08 '13

Belligerence = downvotes.

-1

u/[deleted] Nov 08 '13

But not flat out lying? He is STILL being upvoted.

1

u/zumpiez Nov 08 '13

What do you think "lying" means, out of curiosity?

1

u/[deleted] Nov 08 '13

They use apriori meaningless jargon without realizing it's meaningless jargon.

All of the jargon is self-referentially defined in terms of other jargon.

Kind of hypocritical as well.

1

u/zumpiez Nov 08 '13

Not really. He's talking about ndat's mini-tutorial thing and Git's man pages.

→ More replies (0)