4 ms·
Git's CLI is it's greatest weakness. Someone should really just scrap that part and rebuild it from scratch on sane ground.
by speed_spread 5y ago
Git's CLI is it's greatest weakness. Someone should really just scrap that part and rebuild it from scratch on sane ground.
- aequitas 5y agoYou mean like: https://gitless.com https://gitless.com
- martinvonz 5y agoOr my own project: https://github.com/martinvonz/jj https://github.com/martinvonz/jj. I think https://github.com/Byron/gitoxide https://github.com/Byron/gitoxide also plans to provide a different CLI, but I don't think they've started working on it.
- pfarrell 5y agoPoe's Law is getting me on your comment. If it wasn't sarcasm, what's an example of a weakness? IMHO, there's a learning curve to using git and especially getting to the point where you can be your team's go-to person for git questions. However, I hold the opinion that of the many technologies out there, git is among those that is worth any investment you can make in learning it. Personally, long term use of git has affected the way I code to bring more intention and organization to what I'm doing.
- _dain_ 5y agoquick: explain to me the difference between "git reset", "git revert" and "git restore", without looking up the docs.
- zibzab 5y agoBut are these things a normal user would need to care about? I bet if you created a great git desktop app with outstanding UI it would still have a few corners 99% of users would never touch or understand.
- _dain_ 5y ago> But are these things a normal user would need to care about? ... yes? I've used all three of those commands in the past, although I don't remember what they do. and I'm hardly a git expert.
- globular-toast 5y agoHow to undo a change or revert to a previous version? That sounds like a pretty fundamental thing that a user would need to do, yes.
- zibzab 5y agoIt is usually as easy as "git checkout ID". If that doesn't work you probably have done something really bad to begin with.
- ethomson 5y agoThat's probably not what you want. Checking out an ID would put you in a detached HEAD state, and the CLI will give you the page of warning messages that go along with it. I think that this is an excellent reminder that yes, the git CLI is not simple or obvious.
- karatinversion 5y agoMaybe you are newer to git, but this does not feel like a good faith comment, because “restore” is a command that was added specifically because people complained that the overloading of “checkout” is confusing. Anyway: “reset” changes the ref to which the HEAD branch points, and depending on options can also update the index and working tree to match as well. “Revert” creates a commit that is the reverse of an earlier commit. Restore rolls back uncommitted changes to a file. This isn’t hard?
- giraffe_lady 5y agoWhat definition of hard are you using? It's an industrial strength tool used almost exclusively by professionals and expert-level amateurs. It's definitely hard, the same way knowing what to do with a welding machine is hard. On the other hand, even among the professionals it has a reputation for being tricky and frustrating. Which is not the norm for most critical daily-use tools in this or any professional. So I'd also consider it hard in that sense.
- pfarrell 5y agogit reset: unstage a change git revert: create a commit that reverses a previous commit git restore: you got me. I can't remember
- rileymat2 5y agoReset is more overloaded once you add parameters.
- Accacin 5y agoI'm pretty basic with my Git knowledge. I can merge, rebase, reflog, and the other basic things. However, even I know the difference between reset, revert, restore, and generally use them daily. Now, I generally do not remember many of the extra arguments that can be passed apart from 'reset --hard/--soft', 'git log --stat/--oneline --decorate', etc. Personally I've found git complicated when I've worked at a place with bad 'git' discipline. When I've worked at companies with sane branching agreements, etc. I rarely face problems.
- rileymat2 5y agoDon’t forget rebase if we are doing this.
- spookthesunset 5y agoHmmm.... - reset: "blindly" load whatever commit you tell it into your working directory. This is the one if you add "--hard" will plow over your working directory in a way that cannot be undone. Actually I think without the "--hard" it won't make any changes to your working directory, it will treat whatever is in said directory as a change from the commit you told it to reset to. Dunno... have to look into it. - revert: Creates a new commit that undoes whatever commit you pass in. Often times people mistakenly use this to "undo" a merge into a production branch that shouldn't have happened. The result is trouble when they want to push those changes back into production again. - restore: I have no clue what this does. All I really know is "--hard" is one of like two commands that you can do in git that you can't back out of. "git clean" is another one (I think). Yeah... conceptually Git is kinda easy but the command line is pretty nuts.
- dragonwriter 5y ago> Git's CLI is it's greatest weakness Git’s CLI is good as a unix-philosophy low-level tool that user-friendly tools can build on, and is a strength in supporting a wide range of different workflows. It's suboptimal as a end-user tool for most workflows, but not bad enough for that people consistently build tooling rather than guides for particular workflows.
- trabant00 5y agoFor 20 years I keep hearing these types of complains about Git, Perl, GPG, etc. If you really need those tools than things like syntax, arguments and flags need a little time investment, but after a while they become second nature and you don't even think about them, but about the hard problem that is being made possible to solve by said tools. These are not toys, one should not expect to just jump into them and start doing work like you would not just jump into a Boeing 747 and just take off, fly and land. It having 100s of buttons is not a weakness.
- dahart 5y agoAnd, unfortunately, the CLI is git’s greatest strength as well. Git was designed for the command line only truly flourishes there, for advanced workflows. The GUI tools that wrap git, and web interfaces like github, only provide access to a subset of what git can do. It’d be interesting to see what a good redesign might look like. I do think some of the command names and command flags could be superficially updated/renamed/moved and provide a meaningful impact on git’s usability and learning curve. I’m curious though about whether the conceptual part of git is the primary source of difficulty, whether git is fundamentally a little hard to learn, because it’s fundamentally a little bit complex. If that’s the case, a rebuild might not help, there might not exist the kind of “sane ground” to build on that you hope for.
- nemoniac 5y agoYes, magit.