News for hackers. Stuff that matters.
Re:Git is too hard by remirk on Tuesday November 17, 2020 @04:08AM (#25121547)
Git is one of those technologies where it's super important to get a good grasp of how to internals work. Once you got that, it get easier to answer git questions for others or yourself, and to read the documentation or man pages, as you know what is happening.

With how software devs use git, it's 100% worth it to read a good book on it.

Re:Git is too hard by rednum on Tuesday November 17, 2020 @04:33AM (#25121736)
> Git is one of those technologies where it's super important to get a good grasp of how to internals work.

In my opinion relying too much on user understanding implementation is a mark of bad design. I don't care about more advanced functionalities of git, on daily basis I have very simple workflow that I want to "just work". Sure I can spend few days studying git internals, but it feels unnecessary. Especially given that in the past I've worked with simpler proprietary tools that "just work" (though did not have equivalent of "power" features).

On the other hand I think git is like bash - has some serious warts but it's good enough to be used widely; and unlikely to be replaced by anything else at this point.

Re:Git is too hard by heavenlyblue on Tuesday November 17, 2020 @04:23AM (#25121650)
I am not sure that is true at all.

It’s way more important to understand that git has 0 consistency of what the command name is and what object it manipulates.

Git checkout can create both branches and files. Why? Wouldn’t it be easier to have two commands for checking out a file from a different branch and creating a new branch?

Re:Git is too hard by oerpli on Tuesday November 17, 2020 @05:01AM (#25121942)
I thought they addressed this with "git switch".

https://bluecast.tech/blog/git-switch-branch/

Re:Git is too hard by blux on Tuesday November 17, 2020 @06:21AM (#25122451)
I agree in the sense that it is important to understand the underlying concepts of Git. Once that is clear in your mind, it becomes much easier to use.

When I explain Git to other people I explain it as a tool for manipulating commit graphs, where every node in the graph is a (merge) commit with some unique hash, where a commit itself is just essentially a patch on the previous node(s) in the graph.

Implementation details on how this commit graph is manipulated or stored behind the scenes are not important to understand Git in my opinion.

Re:Git is too hard by IshKebab on Tuesday November 17, 2020 @06:15AM (#25122411)
> Git is one of those technologies where it's super important to get a good grasp of how to internals work.

That's just an excuse for Git being super confusing. Does Microsoft say "it's really important when using MS Word to get a good grasp of how its internals work"? Of course not.

Yes you need to get a good mental model of how Git works (basically, commits are efficient snapshots of your code), but that's not the same as knowing its internals. Do you need to know about packfiles and loose refs etc? No, obviously not.

Re:Git is too hard by zests on Tuesday November 17, 2020 @09:24AM (#25124030)
I gained a lot when I learned the internals of TeX (of LaTeX fame.) Of course I did not learn _all_ of the internals. There's no need.

Is (La)TeX super confusing? Sure. Is it what the pros use? Definitely. Also, read "The TeXBook", it is a masterpiece.

Re:Git is too hard by thrwyoilarticle on Tuesday November 17, 2020 @07:53AM (#25123148)
Schoolchildren can write documents. They can't write software with many authors creating disparate, conflicting changes across vast space and time. Complaining that git is too hard is claiming this is easy.
Re:Git is too hard by IshKebab on Tuesday November 17, 2020 @09:32AM (#25124117)
The parts of it that involve Git are easy. By far the most difficult thing is resolving merge conflicts, but Git farms that out to third party software, and nobody here is talking about that.

The core idea of Git - a DAG of repo snapshots - can be explained in like 5 minutes. I could explain all of the other operations in 5 more minutes.

Maybe I should do a `Git in 10 minutes` video, but there are about a million of those already, and as I said, it wouldn't address the actual hard part of Git: the CLI.

Re:Git is too hard by gspr on Tuesday November 17, 2020 @04:29AM (#25121700)
> Git is one of those technologies where it's super important to get a good grasp of how to internals work.

If you don't have time for a full book, I think Mary Cook's Git from the inside out is a wonderful start: https://codewords.recurse.com/issues/two/git-from-the-inside...

Re:Git is too hard by nikital on Tuesday November 17, 2020 @09:02AM (#25123797)
> Git is one of those technologies where it's super important to get a good grasp of how to internals work.

I fully agree, that's why I built a tutorial where you learn about Git internals by implementing Git yourself in Python: https://www.leshenko.net/p/ugit/

Re:Git is too hard by funtkungus on Tuesday November 17, 2020 @04:20AM (#25121624)
I would also love to get some recommendation on git. I'm using the github desktop gui atm (very new to this world), but I'd like to start learning git. it is kinda intimidating.
Re:Git is too hard by passerby1 on Tuesday November 17, 2020 @04:26AM (#25121674)
Use command line. Try creating playground repo and play with it. You can use github's private repos. Use separate accounts to emulate merge conflicts. Start with only those options you feel need: such as tags and so. Read about work models (git flow, and others). Try them in your playground repo.

Basically it's impossible to learn something without trying and making mistakes, and analysing what went wrong. No failing - no success. You will get it, not that hard. Good luck!

Re:Git is too hard by jlkuester7 on Tuesday November 17, 2020 @09:07AM (#25123850)
https://github.com/FredrikNoren/ungit is one of my favorite Git tools. IMHO it is the perfect compliment to the command-line interface since it provides a nice visual model of your commit graph and branches. The graph is interactive so you can use the GUI for things like merging, rebasing, cherry-picking, etc (very nice for visualizing those changes). But at the same time, the Ungit interface mostly just stays out of your way unless you need it. It does not try to force you into a certain workflow or usage pattern.
Re:Git is too hard by rgoulter on Tuesday November 17, 2020 @04:25AM (#25121667)
If you're more about learning by trying things out, I enjoyed these two:

https://learngitbranching.js.org/ (which presents a visualisation of the commit history)

https://github.com/Gazler/githug (nice for small exercises; although you kinda have to pay attention and not just 'game' your way through it).

Re:Git is too hard by funtkungus on Thursday November 19, 2020 @07:45PM (#25156205)
these are all really great. thanks everyone!
Re:Git is too hard by Mayzie on Tuesday November 17, 2020 @04:19AM (#25121615)
What book(s) would you recommend?
Re:Git is too hard by boriselec on Tuesday November 17, 2020 @04:20AM (#25121631)
Re:Git is too hard by Tor3 on Tuesday November 17, 2020 @04:48AM (#25121858)
That's the one which quickly got me up and running with Git, and made it easier to get a feel for how to do things.
Re:Git is too hard by javisst1 on Tuesday November 17, 2020 @04:30AM (#25121716)
I think https://learngitbranching.js.org/ shows the internals of git's graph model quite nicely.