by P_I_Staker · 4y ago · 0 comments
Occasionally, I'll see articles talk about "fixing" git by eg. removing the staging area, or something like that... but the staging area is great! It's literally a feature I was dreaming about when I used Mercurial.
I definitely think there's room for a more intuitive solution. I would rate the git learning curve as "medium-easy"
For many cases this would be a wrong approach. But git's storage model is quite simple and elegant, and both gives unlimited freedom in adapting it to your needs and could be dangerous if you don't understand it.
When coaching junior devs on git usage I always start with merkle trees, not with a list of commands to remember. This detour takes 20 minutes, but actually gives intuition to fix even worst mistakes without my help when they happen. I can't imagine the same with any other VCS.
It seems most (all?) interaction with the remote is via sync commands: push/pull/fetch. So why bake it into a different command. Commands like "git tag" interact with your local.
Given the abstract concept of a checkout, as it works in git, none of that is surprising (save for maybe that you could create a branch); however, that seems like a desirable feature. Why would you want to do a branch create, then checkout after, when you just want it done right away?
EDIT/P.S. Regarding the git "abstract concept of checkout" that I mentioned, but forgot to define. This is a pretty simple concept: switch working copy to on pointed to by branch reference, and new commits will go on that branch (appended to the end of the branch), create new branch if it doesn't exist (but doesn't this require a flag?)... can't you still create with branch if you really want to?
Git v2.23 (released in August 2019) added "git switch" and "git restore" commands to straighten this up.
If you started out from a blank slate then git's not too bad to learn; I've taught several non technical people to get to the point where they can at least read a git history and have some understanding of what's happening when.
At my current job though a lot of folks came in from CVS, SVN, and TFS and it's been a struggle for many. TFS for instance encourages committing large binaries so when they were migrated onto git, their repos were as large as 50 gigabytes because they have every binary from every release from way back when. I've found they actually need someone to explain why git does the things it does, otherwise they have a very wrong mental model of what's going on. And git's confusing terminology doesn't help at all.
Though once it clicks, it just clicks for the most part.