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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Git and github are not change management tools (rewriting history in git)

14 点作者 mainguy将近 14 年前

8 条评论

ezyang将近 14 年前
The author is misguided about (1) the technical details behind Git (all commits are hashed, so if you cryptographically sign a particular commit tag, it will definitely point to that commit and its attendant history), as well as (2) the obvious/non-obviousness of a rewritten history (if upstream rebases, it's really obvious.)
评论 #2868147 未加载
mortice将近 14 年前
So, in summary:<p>"A hammer can be used for the following things:<p>1. To drive nails into another material<p>2. To 'hammer out' dents in sufficiently soft materials<p>3. As a weapon<p>4. As a doorstop<p>5. etc.<p>Because some people only use it to do (1) and (3), it isn't a tool for (2)."<p>P.S. I know the author acknowledges this in his own comment on the article.
tytso将近 14 年前
You can ammend history in any repository, but all other repositories still have the original state. Hence, someone who tries to tamper with git history in such a way can't do it undetectably. It will be blatently obvious to all that the history has been rewritten, and all other copies of the repositories will contain the original history.<p>If you <i>are</i> going to use git in a centralized way, I suggest you use Gerrit. In addition to providing code review functionality, Gerrit also gives user authentication and you per-user access controls. This allows you to restrict what a user can do when he pushes, so that he can only update a branch (i.e., push new content), and not delete a branch or do a "force push" (which is what you would need to do if you want to replace a branch with entirely new content).<p>It's also possible to customize Gerrit to only allow a user to push changes that he or she wrote herself, which will give you a much more strict audit trail. And you can set these access control parameters on a per-branch basis, so you could allow the release manager to push new changes onto the vendor branch, but all changes to the production branch must be committed by the person submitting the change, and go through code review.<p>So the basic take-away from the article is (a) git is a distributed SCM, not a centralized SCM; and if you want to use git in a centralized SCM fashion, don't do it incompetently --- instead you should use Gerrit, which is designed as a wrapper to Git so it can a secure, auditable, centralized repository.
评论 #2868331 未加载
dasil003将近 14 年前
A good article for the git initiate, but I could do without the sensational headline.
rlpb将近 14 年前
If you don't like this behaviour, you can set a git repository to reject non-fast-forward pushes to it. Run:<p><pre><code> git config receive.denyNonFastForwards true </code></pre> This will permit branches to only go in a forward direction.
pwg将近 14 年前
With apologies to Doug Gwyn -<p>GIT was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
评论 #2868416 未加载
BiosElement将近 14 年前
Pointless article about user error.
escoz将近 14 年前
Great read, thanks!