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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Git is bad. Here's how I'd make it better

1 点作者 fosterfriends6 个月前

3 条评论

fargle6 个月前
&gt; In a modern, closed-source development environment, you can throw out 90% of Git’s complexity. At the end of the day, what does a beginner really need?<p>&gt; That’s basically it. The rest—merge commits, complicated branches, rebasing, staging areas, and intricate commit histories—just aren’t necessary for most everyday workflows.<p>yes, agree.<p>but the takeaway should not be that you need another tool - you can accomplish what is required with a single sheet of paper (or webpage). a table of simple tasks and the commands to accomplish them, tuned to new developers, students, etc. there&#x27;s literally no reason to make a wrapper just for that.<p>there&#x27;s 10,000 things more complicated and fiddly than git that devs need to learn and become expert at.
adastra226 个月前
Sad that all DVCS reform these days involves “keeping git data structures but changing the user interface.”<p>We can do better than the limited model that git provides.
评论 #42377351 未加载
MatthiasPortzel6 个月前
I agree with the initial two bullet points. The git data structures are good, the git CLI is bad.<p>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`.<p>The issue with the git CLI is that it <i>doesn’t</i> expose commands for working with raw git data structures. This prohibits people developing an understanding of what the git commands are actually doing.<p>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.<p>`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.<p>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.