230 points · by hosteur · 3y ago · 286 comments
I learned so much about the commands that intimidated me by playing "Oh My Git!"[1]. It's an open source game that presents commands as quick-to-understand concepts and lets you experiment with them by using playing cards on the visual rendition of a repository. I was honestly surprised nobody else mentioned it here, maybe it's not that well known.
Of course it's not completely accurate all the time in its descriptions but it sure helps understanding the underlying workings a bit more, and it pushed me into actually reading the manual.
I am very happy that there are better frontends for git like Gitless or Facebook's Sapling. I also think their commands are more of a 1:1 mapping to "raw" git operations behind the scenes.
One presumes checkout will eventually be deprecated by switch, but it isn't yet.
I used Mercurial 12 years ago before learning Git - it was a great stepping stone. I loved `hg` CLI as things made sense for the workflow.
But I still don’t want to read their documentation.
To the author: I think I'll need a new name for my tool (I was imagining something fairly different and UI based) so if you want the .io just let me know.
Gitless: A simple version control system built on top of Git - https://news.ycombinator.com/item?id=18512854 - Nov 2018 (138 comments)
Gitless: a version control system - https://news.ycombinator.com/item?id=12621837 - Oct 2016 (372 comments)
Gitless – An experimental version control system built on top of Git - https://news.ycombinator.com/item?id=9144160 - March 2015 (47 comments)
Gitless: experimental version control system - https://news.ycombinator.com/item?id=9019892 - Feb 2015 (48 comments)
Gitless: an experimental version control system built on top of Git - https://news.ycombinator.com/item?id=6927485 - Dec 2013 (46 comments)
Not sure if this solves the issue. I personally recommend using git, but keeping it simple by limiting the allowed operations.
- git switch - git checkout - git add - git commit - git pull - git push - git rebase - git reset
Note the absence of merge and and cherry pick. Most often when a junior has messed something up it seems to be because of merging in a weird order or cherry picking the wrong thing before merging or rebasing.
Either my juniors have stopped asking me for advice (totally possible) or this recommendation helps. As I find myself very seldom needing those commands I hope and believe it's the latter :)
You’re mostly free to do what you want on your dev/name branch. The only thing you really need to teach “juniors” is that they will hate themselves unless they merge main into their dev branches regularly. But if you’re heading home and want to commit something, or you simply commit as often as you click cmd+s, you can do it with no useful comment because it’ll get squashed anyway. Most people where I work use GitKraken, mostly out of habit, but I think more and more are switching to VSC extensions and some might even use the cli.
The result is that we spend almost 0 time on “git” in our organisation. I wonder if we do things wrong somehow since git seems to cause issues for so many people.
Others obsess over history, but personally didn’t find it worth the effort. We look back maybe twice a year, typically fixing issues moving forward.
They should create branch of development/trunk do commits with their work and create PR. Then PR merge in GitHub interface or something.
98% done other 2% get some git specialists.
I use git cherry-pick very occasionally. I agree it's probably a mistake in most cases, but there are valid heavily constrained circumstances where it's fine.
I had never heard of git switch. It looks like just another git checkout?
switch just does what people think checkout does.
It's not, because Git history is immutable [0], you can't change it. But I understand that from the user perspective it appears to change, and the consequences for public history "changes" have to be known to prevent any troubles.
> It is by design impossible to modify or delete an existing commit with regular Git commands.
These are both just straight up incorrect. Make the commit unreachable from all regular branches (this can be as simple as a reset or rebase - and at this point is effectively rewriting history), then gc. Oh, ah you say, there’s a reflog. But that can be pruned/expired with the very same regular reflog command you refer to in your post (or just change the unreachable expiry from 30 days to now). At that point the commit is truly unreachable and a gc will make it go away forever.
FYI the commands git reflog expire --expire=now --all && git gc --prune=now should do the trick about truly deleting commit objects for good.
Also the filter commands allow rewriting history.
This makes a difference because your wording implies that there is some inherent structural invariant that makes git history immutable - and there certainly isn’t, there’s just some default policy for how otherwise unreachable objects are recoverable.
Also I think when most people say (correctly [0]) that git history is mutable it is that by default it is easy to rewrite the history of any branch and basically manipulate the commit graph in any way, and all can be done with the standard command line tools. Bringing in the reflog is mostly irrelevant to the concept of history rewriting.
> But I understand that from the user perspective it appears to change
If you force push to a shared repo, there's no "perspective" about it - the history has changed, somebody else may basically get a completely unrelated graph to what they have in their own repo.
Bottom line: The person you're replying to is correct, rebase is a fundamentally destructive operation, because while the objects in git are immutable the references are not and that's all that matters - because a commit without a reference might as well not exist, it's not a history, it's just a commit. Starting with rebase you can prove to yourself that you can make the repo dispose of commit, tree and blob objects forever. I see the distinction that you are trying to make but I don't see why it is either pedagogically or practically a useful one.
[0] https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History (no scare quotes needed)
Don't see what the big deal is.
In my opinion, the reason for all of this is due to how `git log` shows history. If you merge a branch, then every commit in the branch is now scattered among your mainline history, making it confusing to see what is going on.
So, instead of fixing `git log`, you end up rebaseing (and possibly squashing) on top of the main branch, then doing a fast forward commit so you get a "clean, linear history".
But, if git just change the default of `git log` to `git log --first-parent`, then so much of this would go away.
Only top level commits (directly to the branch, fast-forward merged, or a merge commit) show up in the history.
Now, let's say I have a branch that I've been working on for 2 weeks. I have 20+ commits. During that time, I've already needed to merge the main branch into my branch to keep it up to date several times.
I can either rebase the whole thing, to clean up history, remove the merge commits from main, squash unnecessary changes, and so on, just so I can get a "clean" history in main, or, we can just do a merge commit bringing in my whole branch with a good commit message.
I prefer the merge commit because it is then very easy to track _all_ of the changes made in my branch by a single commit. I can do a diff on the merge commit and see all changes. I can cherry-pick just the merge commit and bring in all the changes. If I need to break down what the original developer of the branch was doing, I can walk through all the sub-commits.
There is no need for them to rewrite history and hide their workflow or their process.
But again, the problem is, by default, `git log` shows this as a huge mess, whereas `git log --first-parent` would _only_ show the merge commit, and would hide all the child commits that happened in the branch. After all, the top level merge commit is what is important, we only care about the subcommits when we need to dig in.
The more-complicated but still safe use is to rebase your local branch on top of an advanced upstream before pushing. Some people prefer merge for this case, but it is somewhat impure.
The problematic use of rebase is on pushed branches. Especially if you have collaborators.
Hint: “git rebase -i HEAD~3” is your friend. So is “git bisect”.
I've used almost every source control system known to humans the past several decades and git for over a decade.
I've heard the git rebase preachers. I tried to get onboard with rebase.
All who read, avoid rebase at all costs at all times, always.
For all those who think that Git is easy, it's not.
It takes a student about 20-30 hours to really understand all usual Git commands. I'm not talking about something bizarre like ls-remote, but really understand merge, rebase, bisect. Not just syntax, but all the consequences. For instance, why rebasing something already pushed to public often leads to false merge conflicts, how does stash really work, etc.
Also, bisect is definitely not common, and the vast majority of my colleagues wouldn’t know it exists; I’d place it into the look-it-up-if-needed category.
But you get rid of those ugly merges back and forth and unviewable histories.. Not sure why not more people care, I guess it is a little OCD I do that for my stuff.. however the 20-50+ user projects where everyone, often multiple times merges develop or even other branches in.. really unusable history right away, lets not talk about any point later. Git has derailed to a mere backup system where you can jump back, but understanding changes later becomes impossible :(
What people also rarely know: A linear history is without lies, but one can sneak additional changes into a merge commit that was in neither branch quite easy - I hate that!
IMO merge is almost never what you actually want, unless you've been working separately for a long period of time (and generally you should not being doing that because it leads to surprising conflicts / regressions at merge time).
But yeah, after that initial push, it's just merges from there on out.
When you merge 17 changes from foo-feature into master, master has only a single commit. You cannot bisect master to determine which of the 17 broke master.
The 17 commits are there, but only in their original form, based on some old commit. Those 17 original commits are not equal to the single merged commit. The single merge could have a bad merge.
If there is going to be a bad merge, it's better to have a bad merge in one of 17 commits being individually rebased, than to have a bad merge in a single merge bomb that conflates 17 commits.
Your little branch of the original 17 commits should be purely a private object; it does not belong in the upstream. It's just a historic accident that your work was originally based on some three-week old random commit that happened to be latest at the time when you started. There is no need for that to be published. Your job is to make sure your code is based on the latest commit and promote it to the branch, as a sequence of individual changes (which all build and pass unit tests, etc).
I've literally not typed "git merge" since 2010, and around that time I learned how not to have Git perpetrate unwanted merges on me by learning never to type "git pull". "git pull" can be configured to be "git pull --rebase", but you will forget. I trained myself to do "git fetch", then "git rebase".
In all my last three jobs, the review tool Gerrit was used. Gerrit is based on cherry picking, which is rebase. Commits are submitted in their original form (not necessarily rebased to the target branch, but indicating which branch they are for). When approved, they are submitted and that means cherry pick. Maybe Gerrit can merge; I've never seen it used that way. Gerit has rebase right in the UI. You can take a commit and rebase it to its logical parent (latest patch set of an apparent parent with which it had been submitted together), or to the current head of the branch.
You start with a "main" rail of coats. Each coat is given a number, indicating what order it is in.
You start adding coats to a new, empty, rail, using the next number. When you are done collecting coats on this new rail, you want to move your coats onto the original rail.
In the time it has taken you to collect the coats onto your rail, someone else has already added coats from their new rail to the end of the "main" rail, and they used the same base number that you have - which means you cannot just add the coats from your rail onto the main rail, else the numbering would be broken - we call this a conflict. (NB: There is a magic guardian of the rails that means this just cannot happen, which is a plot device that is just to make this metaphor work so don't question it, it's just a metaphor.)
To resolve the conflict you have the following "rebase" options:
- Slide all of the coats on the main rail up to make room for yours, and update all of the numbers on your coats, using the new number from the last coat as the base number for your rail's sequence. This ensures that everything on the main rail is "before" your rail. This is the equivalent of a rebase. After this, you can then put your coats on the end of the main rail without conflict.
- Then there is the option to take a copy of the main rail onto the front of your rail, and organising the coats one-by-one (much like in the above), placing your coat(s) in between some of the new coats on the main rail, then forcibly replacing the main rail with your updated rail. This last one is just as drastic in reality as it sounds in this metaphor. We call this the "interactive rebase" and it is rewriting history for anyone who has used the main rail before.
- Finally we have a merge which means adding one big magic coat at the end that takes the coats from both rails and combines them in a singularity, with the new base number being Hawking's radiation or something, I dunno. The metaphor is no good for merges.
(Truth be told: the entire metaphor started in my head some years ago with just the visualisation of that distinct coat rail sweep noise to squish the garments on the rail to onside to fit what our main protagonist is holding onto the rail, the rest I just back-filled over time)
Many new users of git don't have the luxury of learning how to use local-only git with no remote.
Now rebase is a farm implement: a mechanized cherry picker. Cherry picking should be taught first, and then rebase explained in terms of being a multi-cherry-pick operation.
Before teaching cherry picking, you have to teach that Git is based on snapshots and not deltas. Git cherry-pick is part of tooling that is inside Git, but external to its snapshot-based storage model. When you cherry pick some commit into your current branch, the tool finds the common ancestor between your branch and that commit. It then does a three-way diff using the files in the cherry-picked snasphot, your own branch snapshot and the common ancestor-snapshot. The three-way diff operations produce a merged version that becomes a new commit: another snapshot.
If I ran a class on Git, we would spend part of a lecture doing manual merges with the diff3 utility: I would have the students take some ancestor file and make a "my" and "yours" with different changes, and merge these with diff3. We would go through conflict markers and all that.
Old time hackers who used other version control systems before Git knew all this stuff already. The first time I encountered conflicts, I already knew how to resolve them. Just a few git concepts were new like having to add resolved files to the index.
Imagine you know nothing about version control. Words like "unified diff" ring no bell. You've never seen conflict markers. You've never applied a patch or produced one.
Agree.
> I’d place it into the look-it-up-if-needed category.
Disagree. Bisect is so useful in so many different scenarios that learning about it and the basics of how to use it is a great way to get people into git. Obviously not right at the beginning of their learning curve but as soon as the basics have been covered satisfactorily.
Knowing how to use git bisect is what elevates a programmer to the next level. Just understanding how it works gives you a new way to reason about bug finding and fixing (or feature development using old and new), and then actually using it can make you a bug fixing master.
This was not my impression when I first learned about it. I thought I'd be using it all the time.
But 20 hours seems a worthwhile investment to me for something they will likely use for at least the next decade of any serious work with software? I'm assuming that this doesn't mean literally 20 hours of instruction.
The problem is also, if you don't use it daily git knowledge decays fast.
There is a piece of advise that was making the rounds (unironically) at the research institute where I worked before: "Before you do anything with git, first make a local backup copy."
There’s several alternatives where you can be as effective if not more in a fraction of the time. The one that I preferred was mercurial, but unfortunately since GitHub was so successful we are all forced to learn git.
Gitless looks, feels and smells like Mercurial (hg), which is simpler and more effective.
It only took everyone 18yrs to realize it (sarcasm).
Yet most people just want to use VSCode and don't want to invest 20+ hours learning emacs or vim
But you know what? I moved to VS Code a few years ago and my productivity only increased. Everything is more intuitive and discoverable. Everything just works with no tweaking. All the convoluted macros and text manips I painstakingly crafted and memorized in vim are achievable in a few clicks in Code.
Spending 20+ hours learning emacs or vim is quite literally a waste, it's time we all admit it.
(I still think one should learn the basic cursor keys and how to save/quit in vi because sooner or later you'll have to edit something on a remote server with only vi. But learning emacs is still completely useless, though.)
* Vim key bindings for text edits
* CLI commands for Git
* Emacs modes such as Magit and org-mode
* VSCode for tight Typescript integration, nice block structure visualisation etc.
I hope some editor will combine this all. (I think Emacs will be best placed to achieve this with its extension ecosystem that already includes Magit, org-mode, evil-mode etc.)
I spent a lot more than 20h learning emacs. It was my main editor for years.
I use VS Code now. It serves me very well.
To expand upon this, for version control there are pieces of GUI software that can allow you to handle the typical workflows without touching the CLI. Packages like Git Cola, GitKraken and functionality that's bundled with most IDEs as well.
In addition there are also platforms like GitHub, GitLab and Gitea which will let you easily get changes merged across branches with either a single commit or different strategies, all with the press of a button.
I don't think that there is a reason for everyone to do a deep dive into Git, aside from their own curiosity, or when using complex workflows.
That's enough to track changes to your own projects, see the benefit of tracking what you've changed, and build the habit of commiting frequently. IME, adding anything more about remotes and branches is overwhelming to the point they don't bother with git because they aren't going to distinguish the fundamentals from those more complex features.
Obviously branches and remotes are vital in real development, you just can't expect them to learn it all from the start.
Many of the commands don't make sense, and many of them are dumb implementations, which wouldn't be done that way in a clean redesign of git, even if it were based on the same storage model and concepts.
Some of the commands are essentially tooling that is external to the Git storage model and emulates delta-based version control on top of the native snapshot model. The commands lead to fundamental misunderstandings such as that commits are changes.
Well that's actually "create a branch and then checkout that new branch". And you can use "git switch -c" if you feel the "checkout" verb is confusing.
The command to just create a branch is "git branch". Git branch won't touch the HEAD pointer, that's what switch does.
And if "git branch -c" were the command for "create branch and switch", it would be criticised in the exact same way: creating a branch and switching to it would be a different subcommand to that used for switching existing branches. Except now the branch command can also do "switchy" things to your HEAD pointer, but only sometimes (and the fact that checkout also only sometimes changed the HEAD is why switch was introduced).
"Branch <branch> does not exist; create it? [y/n]"
To be fair, I've long used "checkout -b" and I don't think new branches need this, but it might be helpful in special situations like rebase/merge conflicts. I appreciate this sort of interactive CLI in other tools (apt, vite, etc.), versus having to look up the manual for the right options/switches. It's a different approach that might be more annoying to some power users, but is more friendly to most other users.
(This is also where GUIs are helpful, since they display most of the useful commands and options for you. Plus they can do things like see line history by commit and list your stashes for super-easy switching; GitLens/GitLess in VSCode do these.)
https://tom.preston-werner.com/2009/05/19/the-git-parable.ht...
In the same way that you don't need to understand the inner workings of Google Docs, Git should be something you don't even have to learn. Sadly we're not there.
I typically use it as a barometer for how in depth the candidate tries to understand underlying mechanisms of tools they use.
I'd file this question under "trivia the interviewer believes correlates with performance".
Like, asking what a for loop does wouldn't give you any real positive signal, but if they can't answer it's a strong negative signal.
Git is basically just blobs, trees, commits, and refs [0]. Four simple concepts. Yes the interface is confusing and I don't know it either, but things are easy enough to look up.
[0]: I love "fast intro to git internals": https://docs.google.com/document/u/0/d/1X5SnleaX4qpLCc4QMAMW...
It’s probably best to consider that something like git is _not_ inherently interesting and is more likely (subjectively) boring and tedious to humans who are comfortable with simple saving and undoing of files.
Git is the only software where the need for learning its internals is recommended
It is a sign of huge failure of API design
However, the core data model is simple (it is a content addressable store, where each commit contains pointers, forming a directed graph; the pointers are unforgeable, so the graph is acyclic).
There are many sources of interacting states, some internal to git, some not:
the local tree of commits
remote trees of commits
a possible origin relationship between the two
branch labels on each local and remote with possible relationships between them
the HEAD label
stash
index/staging area
the actual working directory
.gitignore
A simple question like which files are being tracked is actually a complex result of several different places in the above. Untracking a file is consequently extremely non-obvious.Describing Git’s behaviour in terms of other version control systems’ semantics (e.g. Subversion or Mercurial) is not necessarily easy, but that’s not what’s being claimed.
But unless you have to work with other people in places like github, etc, it beats having to bother with git - especially for games that have a ton of binary files (which, unlike what some people will tell you, you want to have both version controlled and in the same repository).
Hell, if you really want a DVCS go with something like Fossil, it is still much easier than git, simpler to setup (just a single binary) and has more features (wiki, bug tracker, forum, etc) that you will find useful anyway.
Though personally the best experience i had with VCS is with Perforce, at least in gamedev: check out the latest version, merge any local changes, make modifications in a changelist, shelve the changelist in case i want to stop working on something and work on something else, use the shelve to send a WiP version to a coworker to merge with his changes (or see if things work as expected) or for code review, etc.
Sadly Perforce seems to be bound in a company that tries to sqeeze it for all its worth, adding a bunch of stuff of questionable usefulness, etc. It'd be nice if there was an open source alternative to it that allowed for the same or very similar workflows, all the issues i had with P4 over the years (e.g. merges between streams) were due to how P4 seems to be implemented, not due to anything inherent in the workflows themselves. There is no reason for an alternative to copy all the bugs.
Yes, Subversion is initially easier to learn and use than git. It's not easier to set up as it's client-server while git is fully local. Also Subversion is an incongruous mess.
If you want to go old school there is RCS or SCCS. GNU provides source code (for SCCS there called CSSC). Though *CS are per file not per logical commit.
IIRC Perforce actually used RCS under the covers for storing the deltas.
If your repo ends up in a weird state, learn how to fix it. It should not be terribly complicated, especially if there is no rebasing happening.
Keeping a "bar copy(2) final working.py" file is not about having a nice looking timeline, it makes it very easy to get back to a working state. All you need is copy and paste, or keep the working function as a comment in bar.py. You can see your working code and know you're not messing with it when you're experimenting with bar.py. I'm not saying that's the best way of doing it, but it's a very common use case that's not usually addressed in git guides, where it's all about pushing commit after commit, maybe branching, maybe pushing to a remote with others, but rarely enough focus on undoing mistakes after some experimenting if you didn't branch first.
Stop thinking in terms of branches, and start thinking only in terms of commits. Pretty much every git operation makes so much more sense when you consider your repo just as a tree of commits (technically a DAG), rather that trying to reason about what it does to the branches. Branches are really just pointers to commits which can change over time, and most git commands don't really care about them.
This sounds like obscurantism.
What bad thing happens if students just assume that rebasing something already pushed to public will cause merge conflicts, and just never do that?
https://github.com/martinvonz/jj
Or Pijul if you want to give up on Git compatibility.
And I like this idea of having an alternate model of interaction with git. It seems to fit well within the git design of having common plumbing and being able to swap out the porcelain.
"""If an operation results in conflicts, information about those conflicts will be recorded in the commit(s). The operation will succeed. You can then resolve the conflicts later. One consequence of this design is that there's no need to continue interrupted operations."""
Entering commands in a terminal means you always have have a mental view of the state you're operating in, and having better affordances that are equally as powerful would have made a world of a difference to beginners.
No wonder Git is like C++, where many argue a subset of it would be best to use, but nobody agrees on the exact subset.
Git has improved a lot like erroring out if you try certain operations with unsaved changes, but even this has issues e.g. if you have a file which is untracked in one branch and committed or gitignored in another.
If so, is learning the basics of this abstraction easier enough to justify _not_ learning git — an immensely widely-adopted tool?
If not, how is this preferable to a series command line aliases that the user in question finds more convenient and/or intuitive?
Once you understand merge vs rebase, you understand how git is implemented under the hood, and the rest is dealing with wonky cli syntax.
Publish pushes to the remote (doing the right thing to safety update it, force push with lease).
Synced updates the local branch with the trunkiest-trunk (upstream preferred over origin, using whichever one of main or master exists). It rebases against that remote branch.
https://github.com/softwaredoug/idiot-proof-git
(With handy shortcuts to create a PR and go to the repos URL)
[pull]
rebase = trueI think it's just too hard to create a new abstraction. Git seems too widespread and many people won't switch if they already have muscle memory of the commands. Perhaps we haven't found the correct abstraction yet.
"fuse" looks like rebase.
"switch" with automatic stash is handy (is there more to it?). It's a feature that several popular GUI clients have had for years.
That said - if you are a senior on a project using git flow or something like it - you should treat understanding git as a concern of the first order. The commands are somewhat obtuse, but the tool is a pretty reasonable attempt to grapple with the underlying challenges of managing disparate work from different people going at different speeds. It is challenging to understand because it is fundamentally quite difficult. Don't under-rate the importance of this to your overall process! Learning git will help you understand the challenges of distributed development (and visa-versa) - they are real and not simply an artifact of bad UX.
I will say this: I find git much better than Microsoft's Team Foundation Server (I know it can be setup to use git now) but I like git overall a lot more.
Does anyone think any of the competitors to Git will take off? I hesitate to move to something else because inertia is a thing: all my stuff is on github, the team and all my colleagues at work know it, guides exist for it online, but then again ... if I could master a better tool I could teach everyone... hmm.
Perhaps my professors don't know git because they got their PhD before git was invented (2005), and they never needed to learn it.
Unfortunately it doesn’t work on Windows.
That tracking concept is worse than Git's staging area. It expects you to know what to track before making your changes which is almost never the case. Maybe you can track after the fact; then, it just becomes an alias for `git add`. Why confuse people with this? How is this simpler?
"You can stop tracking changes to a tracked file with the gl untrack command"
Does that mean if I stop tracking, the rest of my changes will be ignored, or that file will be excluded from the upcoming commit? What happens if I track a file for a brief period of time, but edit it before and after tracking? What would I be committing then? Am I expected to understand how this works in order to keep a decent commit history?
"You can always revert a file back to some previous version with the gl checkout command."
So, use a command that's entirely different ("checkout") than the intention ("reverting"). Sounds like Git to me. How is this better?
Git CLI is bad, yes, this seems to be no improvement whatsoever.
The first point explanation is not so simple
Though I will love the independent branches, not have to stash everytime moving between branch.
Looking at how a lot of students learn by trial and error, being able to be a little more verbose on what they're trying/have tried would make this trial and error so much easier, and also be more descriptive/conscious of what they're doing.
Having effectively gotten rid of the save button with auto-save, why didn't we replace it with a 'tag' button?
What I think should be there is a daemon doing autocommity and automatic sync with server. Even if you work from multiple machines.
Furthermore, it could work in architecture terms, such as an MVC files that could be tracked as an individual unit. The architecture for a file system could be defined and enforced in a git file, it could spot missing pieces.
Also, it needs dependency management for these units.
1. Completely alter the paradigm for editing software: from editing text to editing the AST (or a projection of it). See Unison [0]. This gives you fine-grained understanding of every aspect of the development flow, but requires rewriting most of the tooling that developers are already using.
2. Layer the smart features on top of the existing text streams. This gives you less control and is more resource intensive, but you don't throw away the entire developer ecosystem.
If we choose #1, we waste millions of man-hours building these tools for every new language.
If we choose to layer our language-specific features on top of text, then why does this need to happen at the Git level instead of at a higher level of abstraction? IntelliJ, for example, can already use the git history to tell you who wrote a given method and when. This kind of functionality could, in principle, be extended to following the history of a method when it's moved or renamed.
Is there any benefit gained by having the VCS itself do the language-aware processing instead of having language-aware tooling layered on top of the VCS?
This does not generalize very well. On top of GIT‘s core data structures and file management facilities you would also need parser plugins for all languages now and additional commands to manage language constructs. This would make it even more difficult to grasp.
I would say version control of text files in general is not an easy problem. GIT‘s complexity arises from the complexity of the problem it solves. Perhaps the user interfaces of subversion or mercurial are easier but I don’t think they lift the burden of understanding version control and why it is necessary from beginners …
Once you understand a DAG and the concept of a hunk, it's easy to say what I want to do, but using the command line tool makes it a pain in the ass.
It also doesn't help that the rest of the user interface is a bunch of complicated behaviors tacked onto marginally related commands.
The underlying model is also weird. You would expect it to be diffs, but instead it's full files. Fortunately you can ignore that.
Git: unnecessarily difficult since it was invented.
This sounds like something C# programmers would dream of having or making.
since it got bought by Unity, they've discontinued it... so my license of it evaporated. I've missed it a lot, having to diff with kdiff3
In general this seems like it was done by somebody with not more than a very basic understanding of git...?
This looks like you will get a lot of "Merge main into main".
Learn git properly. It took me a few weeks in my first job, and it was done. I dont understand how people can sit here and lean a million intricate rules of css, rust lifetimes, or whatever else, and refuse to use a tool that works very, very well once learned. Its not easy, its not fun, but its IMO the smart way to do it. You dont unlearn git, you learn it once, and you use it.
https://github.com/gitless-vcs/gitless
and no Windows support. no thank you.
Learn to use `git rebase` and learn to use `git commit -p`.
/s
in absence of a tyrannical dictator, it may not even be possible.
Git is the only software where the need for learning its internals is recommended
It is a sign of huge failure of API design
a linear, immutable, series of commits in the only branch that is suffered to exist.
git, the good parts.
it also pairs well with a simplified remote[1].
Learning how to handle common edges cases is incredibly frustrating and challenging. It's rarely obvious what's wrong and how you're expected to fix a problem. Even worse, the stakes feel incredibly high. If you do something wrong, you risk loosing your work. Or, even worse, messing up someone else's work.