3 ms·
I agree with the initial two bullet points. The git data structures are good, the git CLI is bad. However, the issue with these attempts to create a user-frien
by MatthiasPortzel 2y ago
I agree with the initial two bullet points. The git data structures are good, the git CLI is bad.
However, the issue with these attempts to create a user-friendly wrapper over the git data-structures, is that that’s what the git CLI already is. The ideal form of git that you explain to beginners is `git switch -c branch-name`, `git commit`, `git push`. This is not any more complicated than OP’s `sg create`, `sg save`, `sg submit`.
The issue with the git CLI is that it doesn’t expose commands for working with raw git data structures. This prohibits people developing an understanding of what the git commands are actually doing.
I’m at the point where I understand git well enough that I’m very rarely in the situation that OP describes, of guessing whether a git command will work, or asking ChatGTP for help. However I’ve gotten here by slowly memorizing what every git CLI command does to the underlying git data structures.
`git commit` creates a commit and updates the current branch pointer. `git commit --amend` created a new commit with a parent that is the commit before the commit at the HEAD pointer and updates the branch pointer. `git reset --hard` updates the current branch pointer and the files to match. `git push` runs `git fetch` and then `git merge`. `git merge` creates a new commit with two (or more) parent commits and then updates both branch pointers (if applicable) to point to the new commit. etc. etc. etc.
So I hate the git CLI because it tries to be beginner friendly by supporting a ‘normal coding workflow’ and it ends up being more complicated than just understanding the raw git data-structures.