4 ms·
Yeah, I too don't really understand git. It seems that it was developed without any concern for affording a good mental model of its operation to its users, and
by AnIdiotOnTheNet 8y ago
Yeah, I too don't really understand git. It seems that it was developed without any concern for affording a good mental model of its operation to its users, and thus it is just a complex black box you chant arcane rituals at and hope it doesn't decide to burn your world down. I know I could build a mental model of it if I put enough time into it, but who wants to do that when there's actually useful things to do? So instead when I have to use it to contribute to open source projects I have a sheet of notes with incantations to cover the specific things I've had to do with it in the past.
- cabalamat 8y ago> It seems that it was developed without any concern for affording a good mental model of its operation to its users I think Linus' design goal was something that runs as quickly/efficiently as possible on large repositories. > it is just a complex black box you chant arcane rituals at and hope it doesn't decide to burn your world down My feeling too!
- influx 8y agoNo, his design goal was to create a vcs for the Linux kernel. Frankly most people use git like svn version 2, completely skipping the distributed parts of it. Git actually doesn’t scale to really huge monorepos.
- Deganta 8y agoThat's because most users don't actually need the distributed part of git. For most projects the sanest solution is to have a single master repository that all users pull/push from/to. IMHO the only real advantages over SVN for most users are the better branch/merge functions.
- jancsika 8y agoIn other words-- git is so good at being decentralized you only notice the consequences in the improved branch/merge UX.
- cabalamat 8y ago> his design goal was to create a vcs for the Linux kernel Which is a largish piece of software.
- totallymike 8y agoThis is a valid point. Git is sometimes incomprehensible. The best way to build a mental model for me has been to read about directed acyclic graphs. It’s all just trees, objects, and labels for trees and objects from there. Also to learn that `git reflog` exists, and gives you pointers to all the old states of your repo, even mid-merge or mid-rebase. If you get stuck with a bad rebase, you’re only a `git reflog; git checkout HEAD@{3}` away from being back where you started. Tutorials like this one and others mentioned throughout the thread do a good job of breaking down the viscera from there.
- hvis 8y ago> black box Have you tried looking into any other contemporary DVC systems? I get Git, more or less. Having tried to make sense of Bazaar or Mercurial on several occasions (to understand the internal data model), I eventually gave up.
- pdonis 8y agoAre there other VCSs that you find it easier to understand and build a mental model of?
- AnIdiotOnTheNet 8y agoPersonally I just rely on daily backup of my workstation and manually copied and compressed snapshots of the project when I feel significant progress has been made. I tried SVN once, but it wasn't very transparent what it was doing and didn't really enhance my workflow any.
- pdonis 8y agoIs all of your coding projects that you are working on by yourself? Or do you have to share code with other people?
- AnIdiotOnTheNet 8y agoAll my personal projects are just me. When I contribute to open source projects I use whatever they use, which is usually git. At work, even though I am usually the only programmer on my programming projects, I use TFS because that's the company's process.
- nlawalker 8y ago>> developed without any concern for affording a good mental model of its operation to its users, and thus it is just a complex black box you chant arcane rituals at That's not git, that's the command line - the interface with no inline visualization, no discoverability and no affordances. git is not its command line interface. I use the git CLI like I use curl: a powerful tool for occasional surgical or automated operations directly on underlying protocol. Most of the time I prefer something that better fits my workflow: for git, it's Git Extensions; for HTTP, it's Chrome.
- chousuke 8y agoI have the exact opposite problem. I have a mental model of git, but not a very good one for most of its competitors; I don't really get mercurial for example, but git is just: 1) uncommitted stuff in workdir. Potentially can be lost, so commit often. 2) blobs in repo representing snapshots at commit time. Can never be lost. 3) symbolic references to the blobs. Can always recover from reflog. 4) tools to sync the above two things between repositories. (fetch and push) 5) tools to merge, diff and otherwise manipulate the changes between snapshots and files. I'm confident that git will never lose my data, so long as I commit it. This makes experimentation stress-free. Technically, you can lose data by explicitly deleting your refs, expiring the reflog, and running gc, but if you go that far you might as well rm -r .git
- krupan 8y agoMercurial is the same except: 0) you forgot to explain git's index. Mercurial doesn't have the index, it works how you described git. 2) data (blobs, revsets, whatever) in the repo actually can never be lost, there is no automatic gc 3) no need for some different tool/viewer to view commits that don't have refs Technically there are several ways to remove data from the repo, but it never ever happens automatically behind your back.
- chousuke 8y agoThe mental model helps me with git because it maps pretty closely to what data actually exists. The index is just a useful thing to help me put stuff into a repository in a controlled manner. I've never attained a similar transparent understanding of mercurial. I think I've asked this before, but what exactly are mercurial's branches? In git, they are a "physical" feature of the repository as it represents a set of lineages, not an actual repository object. As such, any reference to a commit uniquely identifies a branch, so the concept of a "named line of development" is simply implemented as a reference that gets updated as you make more commits. When you "delete" a branch in git, it goes nowhere. Only its name is removed. What sort of structure does mercurial use to represent its branches? I know they are not just an emergent thing like in git.