TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What makes Git so hard to use?

48 点作者 thijser超过 2 年前

36 条评论

hbn超过 2 年前
The git UI built into JetBrains IDEs is the only thing that makes git work for me. It&#x27;s very intuitive to use.<p>Cmd+K to commit changes. There&#x27;s a list of all files changed, organized by file hierarchy. You can click any of them to get an embedded editor and you can edit right from there.<p>There&#x27;s a VCS pane you can pop up to view commits from any of the branches you have pulled without switching, you can select commits and right click &gt; cherry pick to pull them into your current branch.<p>And the diff resolver is perfect. 3 vertical panes with the incoming and local changes on the left and right, and center is the merged product. You can press arrows on each side to bring those changes into the center, it shows right where they&#x27;ll go with colored highlighting before you even make any changes. And the center is once again an editor so you can just manually type in it to resolve conflicts too.<p>Git&#x27;s mental framework is so visual for me, it just seems like a better experience in a GUI. Especially one as well-thought-out and intuitive as what JetBrains came up with.
评论 #33627334 未加载
评论 #33627214 未加载
评论 #33627696 未加载
评论 #33629066 未加载
评论 #33628034 未加载
评论 #33632539 未加载
noufalibrahim超过 2 年前
If I had a dollar for every time someone complains about how git is unfriendly, I&#x27;d have enough to buy Twitter.<p>I&#x27;ve been using version control systems since CVS and I&#x27;ve found git the easiest and most sensible thing to use. Admittedly, some of the commands reflect internal data structures and concepts rather than what a user would want to do but that&#x27;s just a learning curve issue. To address specific points.<p>1. Of the 157 commands, there are maybe 10 or so that one would need on most days and maybe 5 or 6 others when things go awry. Perhaps another half dozen for specific workflows but that&#x27;s it. How many times do people use git daemon or git instaweb or git fsck? Why are these listed there? I do git trainings and teach a handful of commands in half a day which are sufficient to get people started.<p>2. The index has been extremely useful to me when I code for a while and then later need to commit only some files or parts of files into separate commits. This is a &quot;good thing&quot;. The workflow which the author is suggesting would be like a &quot;git commit -am ... &amp;&amp; git push&quot; which is not ideal<p>3. There are two destructive commands. git checkout and git reset when you&#x27;ve not committed. These two can discard uncommitted code in the working tree and you&#x27;ll lose them. Once you&#x27;ve committed, it&#x27;s possible to undo almost anything using the reflogs. They&#x27;re very useful and worth learning how to navigate and use. Even rebase --hard can be undone by switching to a previous reference.<p>I think this is a deliberate decision. git is a power tool that sacrifices protecting the user from mistakes to give the user fine grained power over a project. A tool that hides these things from a user and tries to wrap the whole thing in a veneer of user friendliness might be good if engineered properly but my feeling that is that it wouldn&#x27;t be worth the sacrifice.<p>Highflux itself advertises several things like &quot; Automatic commit on every editor save.&quot; which I&#x27;m not sure are good ideas. I hit save repeatedly while working. Each one of those saves is not meant to be a commit.
评论 #33632293 未加载
评论 #33628987 未加载
评论 #33627442 未加载
评论 #33627717 未加载
评论 #33627331 未加载
philipwhiuk超过 2 年前
The idea you somehow NEED to learn all the commands as a reason why it&#x27;s hard is crazy.<p>Adding HighFlow on top will just add more commands because inevitably there&#x27;ll be a point where some HighFlow abstraction fails and you have to go to Git anyway to fix it.<p>Also I can see that HighFlux runs as a daemon. That seems sub-optimal - sucking up my CPU all the time on the off chance I want to code something is not great.<p>It doesn&#x27;t seem like HighFlow supports actual remote repositories except GitHub. Which is the entire point of a distributed version control system - to be distributed.<p>I think HighFlux is designed to solve a very limited subset of Git&#x27;s usage and so they&#x27;ve stripped out a lot of useful commands they don&#x27;t use and so they can ship a product.<p>But in the real world people will need this and their simple vision will crumble back to the complexity of Git (or close).
评论 #33627215 未加载
评论 #33627248 未加载
rchaves超过 2 年前
Gitless folks did some actual user research years ago, getting feedbacks on various tasks difficulty, and they have a nice theory of api misfit, I really recommend the read for more structured speculation of why git is hard: <a href="https:&#x2F;&#x2F;spderosso.github.io&#x2F;oopsla16.pdf" rel="nofollow">https:&#x2F;&#x2F;spderosso.github.io&#x2F;oopsla16.pdf</a>
评论 #33627058 未加载
评论 #33627063 未加载
athorax超过 2 年前
I think git is hard because 99% of the time it just works with little to no required understanding of what you are actually doing. That is to say that git is actually too easy... until it isn&#x27;t. Once you hit a scenario where you get off the happy path, that is when git becomes hard.
评论 #33627351 未加载
评论 #33628995 未加载
评论 #33627478 未加载
PaulHoule超过 2 年前
I find this message hard to get because git is dramatically easier to use and more tolerant of mistakes than previous version control packages. It&#x27;s certainly true that looking at the man pages could drive almost anybody insane but working from a cookbook it is very easy. (Most of the time I think it is a mistake to &quot;Google&quot; for answers but rather you should learn to look things up in the official docs. Git is a counterexample)<p>Visual Source Safe would outright die when your repository overflowed a 32 bit file.<p>Changing a wrong commit message was almost impossible with CVS.<p>I push into the wrong branch and make other mistakes like that sometimes with git and I have no fear about it at all and little stress because I can always look in the cookbook and find the recipe to fix it.<p>Git also is the basis for numerous tools such as GitHub that are accessible to non-technical users. Git is the only version control system I&#x27;ve seen that can be used like that.
评论 #33626884 未加载
评论 #33626575 未加载
评论 #33627327 未加载
lordnacho超过 2 年前
It&#x27;s hard because nobody thinks of it as a part of their job. Like coding is to some people, git is often a thing that you just have to do.<p>So then you don&#x27;t learn how it really works, and you get weird problems because you never formed the right model in your mind.<p>It&#x27;s also the case that there&#x27;s a few commands you use a lot, but a lot of commands that you reach for only in specific cases. This creates the impression that it&#x27;s too complicated, because as soon as you go off road you get stuck.
评论 #33627238 未加载
评论 #33627125 未加载
评论 #33634767 未加载
P_I_Staker超过 2 年前
Disagree that git is hard to use. It&#x27;s fairly complex, I&#x27;ll admit, however it&#x27;s pretty much all &quot;necessary complexity&quot;.<p>Occasionally, I&#x27;ll see articles talk about &quot;fixing&quot; git by eg. removing the staging area, or something like that... but the staging area is great! It&#x27;s literally a feature I was dreaming about when I used Mercurial.<p>I definitely think there&#x27;s room for a more intuitive solution. I would rate the git learning curve as &quot;medium-easy&quot;
评论 #33626971 未加载
评论 #33627729 未加载
评论 #33627088 未加载
评论 #33627041 未加载
Justsignedup超过 2 年前
Honestly, I have loved git ever since I started using it.<p>- I use sourcetree for committing, it is a great UI tool for seeing your commit graph and just entering commit messages &#x2F; partial commits &#x2F; selecting which files to commit<p>- I use command line for all pulling&#x2F;merging&#x2F;fetching&#x2F;branching etc. Git command line is just so simple IMO (once you get a short intro to it).<p>- Repairing issues in git is honestly not difficult.<p>- The hardest part of git is branching, merge conflicts, and squashing. When you combine all 3 is where it gets challenging if you don&#x27;t know how to avoid any gochas. But it does make for nice revision history.<p>So I guess if you are doing some crazy complicated git stuff, I can&#x27;t speak to that. But in 8 years I can definitively say I have only enjoyed git, and have often been the person to debug issues with people using git, and it is always a fairly simple thing to un-screw things up.<p>Criticism: push -f is definitely a dangerous operation. I can see why the mercurial team said no history rewriting period.
评论 #33627118 未加载
donatj超过 2 年前
&gt; Git has been trying to create less confusing commands (like splitting git checkout into git switch and git restore)<p>I really don&#x27;t know why anyone would use these new &quot;easy&quot; commands. They don&#x27;t feel that much better and their existence irks me because now there&#x27;s even more ways to do the same thing.
评论 #33627295 未加载
alon7超过 2 年前
I agree that git is very non-intuitive to learn when you first start working with it, and it&#x27;s great to see a number of teams trying to make this better.
brap超过 2 年前
Hah, just today I was wondering how come no ex-Googlers tried to tackle VCS, and now here it is, apparently by ex-Googlers.<p>Dev experience at Google kinda sucks for the most part, but one thing that works <i>amazingly</i> well is VCS. You never even have to think about it, it literally just works, and it works at very large scale (monorepo for all of Google).<p>It’s just: 1. Create a workspace 2. Submit the changes in your workspace<p>And that’s it. I hate going back to the mess that is Git.
评论 #33627604 未加载
pmoriarty超过 2 年前
One misunderstanding I had that about git was thinking that branches contained more than one commit, while actually they&#x27;re kind of like a movable tag that points to a single commit.<p>Learning what rebase actually did and the difference between reset soft&#x2F;hard&#x2F;mixed along with using the reflog to get back to previous states made git a lot more understandable to me.<p>That said, if you want to see how insanely complex git is, try reading its many man pages.
Ericson2314超过 2 年前
An underlying problem is git is a file system on top of a file system.<p>If every time the journal &#x2F; write-ahead log was flushed, the files were rehashed, we wouldn&#x27;t need index vs non-index so much.<p>We would use normal commands to sync two work trees one being what we have, and one being what we want to commit.<p>Instead of .gitignore we simply should have temp files elsewhere.<p>Basically the file system is a bad abstraction and all VCS is ad-hoc work around it.
评论 #33627476 未加载
billpg超过 2 年前
One thing I wish git did differently was to have an atomic commit-and-push operation. I&#x27;d like to prepare my commit as normal, but when its ready, it pushes that commit as well, but if that push fails, it undoes the commit.<p>Why? I recently configured my github to use a hidden email address. To this end, it required me to use a github.com email address it generated for my commits. I set it up and started pushing commits, everyone was happy.<p>Then I went to a different folder that had a separate clone of the same repo, and I forgot I had configured github this way. I made some changes and did the usual commit-and-push but github rejected it. I had used the wrong email. Oops.<p>But now I had a problem. My local repo had the commit with the wrong email address in place and I didn&#x27;t know to change it. I couldn&#x27;t make a new commit with the new email as the old one was still there. I looked up how to revert already committed commits and long story short I did it wrong and deleted all my recent changes.
评论 #33628338 未加载
jon889超过 2 年前
When I realised that branches were just labels pointing to a commit, instead of a an actual &quot;branch&quot; ie a group of commits, then everything made a lot more sense. I still kinda wish branches were more groups of commits, so that if you have multiple branches on top of each other they can automatically&#x2F;more easily keep up to date.
1ark超过 2 年前
I feel an engineer is incomplete without knowing their daily tools more than the basics. I find it frustrating to work with people who don&#x27;t make the effort to learn git. Urging them to relax and take some time to read up or go through guides. They are fine spending time learning new languages or frameworks on their spare time, that they then want to bring into work. But spending a weekend reading some blogs about git or the short manuals is somehow tedious. Many times they can&#x27;t write a proper commit message, and when they get a merge conflict they kick and scream, and you have to solve it for them. It&#x27;s not that hard to go from a beginner to an intermediate user of git. And the trade-off can be quite significant with the confidence in managing around git. Learn from the CLI first, then jump onto tools that fit you (shout-out to magit!)
raspyberr超过 2 年前
With the amount of Git-skeptical articles that have been popping up recently, I&#x27;m starting to get worried that someones gonna come along, make some fancy and shiny centralised VCS, market it like the cure to cancer, and all the new developers will eat it up and 8 years after it&#x27;ll be a bloated hellscape.
anotherevan超过 2 年前
“Git gets easier once you get the basic idea that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space.”<p>— Isaac Wolkerstorfer<p><a href="http:&#x2F;&#x2F;twitter.com&#x2F;agnoster&#x2F;status&#x2F;44636629423497217" rel="nofollow">http:&#x2F;&#x2F;twitter.com&#x2F;agnoster&#x2F;status&#x2F;44636629423497217</a>
dbrueck超过 2 年前
My biggest git gripe is that its cognitive load can get high pretty quickly, while really for a VCS you want it to be powerful but stupid easy all the time. For example, if you try to find info on best practices on non-trivial git stuff, you find compelling and well-articulated arguments that are diametrically opposed to each other (see: rebasing).<p>I use git constantly and hardly ever have problems with it, but only because I use a tiny fraction of it and I religiously follow an exact process every time. I&#x27;ve had people tell me all sorts of reasons why my approach is not good, and they&#x27;re probably right, but it&#x27;s really nice to not have to give my VCS very much thought 99% of the time.
bumf超过 2 年前
&gt; <i>Git commands are too many, too low-level and hard to understand.</i><p>Most of these are &#x27;plumbing&#x27; commands, not &#x27;porcelain&#x27; commands. Perhaps the author should have read the book on the Git website¹, as it explains this.<p>&gt; <i>Git tracks 4 versions of files, instead of just &quot;my&quot; version and &quot;the team&#x27;s&quot; version.</i><p>This is because it&#x27;s a distributed version control system, not just a tool to upload files to GitHub.<p>It seems like the author hasn&#x27;t even taken the time to understand the basics of Git, and its design goals, before writing this ignorant screed.<p>_<p>¹ <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2</a>
评论 #33627876 未加载
pugets超过 2 年前
The lack of a `git undo` is the reason why I’m afraid to try git commands I haven’t yet needed. I can’t exactly “move fast and break things” if I’m always two errant commands away from receiving unwanted attention from my team.
评论 #33628323 未加载
chaostheory超过 2 年前
&gt; Git doesn&#x27;t let us safely experiment<p>Isn’t this one of the main purposes of branching?<p>Also git is easy to use. You can ignore the non-basic commands as a small team or solo dev, and there are plenty of GUIs to help with UX
lbriner超过 2 年前
For me, there were a few weirdisms in the wording of some commands but they weren&#x27;t show-stoppers. I think for people like me who came from centralised CVSs, it was that Git was actually more powerful so it seemed a bit overwhelming or un-necessarily complicated.<p>Once you realise why git is like that, I haven&#x27;t found it that bad.<p>It&#x27;s no different than someone who has only ever ridden a bicycle asking why a motorbike is so hard to use. Because it does more stuff.
alcover超过 2 年前
I love writing hardcore C code full or pointers and cross-calls but for some reason I can&#x27;t get bothered with semi-advanced Git.<p>There&#x27;s a dread, a fatigue... I got burned merging (or was it rebasing?) and now I often just <i>copy</i> my folder to make a temp branch.<p>By the way, how do you extract a file from an old commit without checking out (and crushing your current files..) ? No hassle with the old folder-copy-tech !
评论 #33628169 未加载
pixelfog超过 2 年前
I guess git seems complicated when you go deeper into it. I just learnt the basic stuff (add, commit, push, pull, checkout and create branch, status, stash and reset merge) and haven&#x27;t gone beyond it. I remember seeing some post on HN on how to make git easier to use and the person had written some aliases of commands that I had never even seen&#x2F;used before!
yoah超过 2 年前
I am happy to see startups working on improving git usability. Git is so hard to use when things get out of the simple path.
fragmede超过 2 年前
On top of all the other concepts being introduced at once, staging seems to be a difficult one.
metadaemon超过 2 年前
There&#x27;s only really ~5 day-to-day commands that you need to know to use it. Going past that is mostly unnecessary and frankly pretty pointless.<p>checkout, pull, commit, push and reset if you make a mistake. I&#x27;m not including one time commands like clone and init.
newbieuser超过 2 年前
My favorite thing about git is that it allows you to solve different processes in different ways but basically with the same logic. everything done affects a history and all one has to do is focus on the history.
kristopolous超过 2 年前
It&#x27;s always been a UX problem and it&#x27;s gotten much better.<p>Here&#x27;s something I posted 7 years ago over on a reddit comment thread about it<p>---8&lt;---<p>I&#x27;ve been running a git hater twitter account for years and have had git use me, or me use it, for 8. (<a href="https:&#x2F;&#x2F;mobile.twitter.com&#x2F;githater" rel="nofollow">https:&#x2F;&#x2F;mobile.twitter.com&#x2F;githater</a>)<p>I &quot;grok&quot; the concepts. I do not however, get the broken command line interface. How is an error message like this at all helpful:<p>git push -u origin master<p>error: src refspec master does not match any.<p>That&#x27;s not even a proper english sentence.<p>Here&#x27;s an example of the three counterintuitive undiscoverable ways to do one common thing that everyone wants; be able to push and pull from a branch without specifying it each time.<p>git branch m<p>THEN<p>git checkout m<p>THEN<p>git push -u origin m<p>OR<p>git branch --set-upstream=m origin&#x2F;m<p>Or if you want<p>git checkout --track -b m origin&#x2F;m<p>How do you push to a branch?<p>git push origin m<p>how do you delete a REMOTE branch?! Same thing, but prefix it with a colon<p>git push origin :m<p>How do you delete a LOCAL branch? Use a different command, with a different option<p>git branch -d m<p>Show useful information about tags? What about sorting them, by date. Sounds typical, common if you dare say... If you think it&#x27;s in git-tag, your princess is in another castle. You need git-for-each-ref. Here&#x27;s the simple to remember magic:<p>git for-each-ref --format=&quot;%(taggerdate): %(refname)&quot; --sort=-taggerdate --count=10 refs&#x2F;tags<p>So easy to use, no wonder it&#x27;s number 1.<p>how do you rebase? It&#x27;s a simple task!<p>git rebate --onto something commit id that is one before where you actually start from [ space, not 2 dots like everything else ] commit id where you want to end at ...<p>Great, now you are in a &quot;detached head&quot; state. So the rebase onto didn&#x27;t actually rebase on to it ... yeah ... about that...<p>---8&lt;--- (from <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;3qt28h&#x2F;xkcd_1597_git&#x2F;cwi4eni&#x2F;.compact" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;3qt28h&#x2F;xkcd_15...</a>)<p>So in conclusion, the documentation was full of arcane discussions in domain specific jargon. The interface was wildly inconsistent and asymmetrical and the errors were cryptic and unhelpful.<p>Here&#x27;s a fun one. If you just git init and then have multiple users start pushing, you know, like the documentation encourages you to do, the objects database files get the ownership of the person pushing upstream and then can lead to wildly cryptic intermittent permission denied errors because the database is actually just a bunch of unix files. Yes there&#x27;s many ways to fix this, but that&#x27;s not the point. Why is a deep dive discovery process needed to make basic things work in obvious ways? It&#x27;s a Heathkit when all you need is a calculator.<p>When you expressed these complaints people would respond with theoretical introductions to branching and ASCII art diagrams.<p>It was all no good. I even tried some futile attempts over 10 years ago to contribute to clean things up.<p>The problem was I was unable to convince people deeply intimate with the codebase that there were hostile user patterns that could be alleviated with a bit of expository writing. All the cryptic jargon was utterly clear, exact and concise to someone who&#x27;s spent 1,000 hours on the source. &quot;Many people find these interface patterns confusing&quot; was met with &quot;we have academic level documentation with diagrams&quot;. Alright. Useless.<p>It&#x27;s gotten a lot better though.
评论 #33627556 未加载
评论 #33627502 未加载
weba11y超过 2 年前
I think some of their &#x27;issues&#x27; could be resolved by learning things like git reflog (e.g. the &#x27;undo&#x27; command request)
mgkimsal超过 2 年前
The article mentions a lack of &quot;undo&quot; with git. This is one of the reasons I use a GUI git tool - specifically I use Tower for Mac right now for <i>most</i> of my day to day git. I still CLI stuff now and then, and Tower still spits out messages that force me to command line when it gets itself in to a state (rebase&#x2F;conflict resolution sometimes). I can&#x27;t recall other GUI git tools having an undo, but maybe some do now?<p>tldr: the &#x27;undo&#x27; in Tower has been <i>really</i> handy for me over the past few years. Really handy.
_steady超过 2 年前
IMO got is intuitive and easy to use therefore the title is subjective and incorrect. Please update to be less of an opinion.
yakirp超过 2 年前
Looks great. I will give it a try
rod_ochoa超过 2 年前
I think is very easy to use
评论 #33628592 未加载