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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Git Add -p

1 点作者 joshbetz超过 3 年前

2 条评论

WhyNotHugo超过 3 年前
`git add -p` is super useful.<p>(1) you get to review changes as you stage them, which is good to confirm that all the changes still make sense.<p>(2) if you have _some_ changes that you want to commit, but not others, this avoids screwing up.<p>Honestly, I can&#x27;t image using git without this.<p>Oh, and, please, don&#x27;t use `git add .` and blindly stage+commit changes. It&#x27;s honestly one of the worse common practices I&#x27;ve seen around.
cratermoon超过 3 年前
The author enables auto-formatting and linting in his editor. He then runs into the problem of huge and meaningless diffs when working on code that doesn&#x27;t conform to the formatting and linting settings.<p>His solution is to add complexity, effort (and opportunity for errors) to the process, rather than thinking, &quot;maybe automatically reformatting the source code is something that should be done more selectively&quot;.
评论 #28776612 未加载