Git and github are not change management tools (rewriting history in git)
mikemainguy.blogspot.com
mikemainguy.blogspot.com
"A hammer can be used for the following things:
1. To drive nails into another material
2. To 'hammer out' dents in sufficiently soft materials
3. As a weapon
4. As a doorstop
5. etc.
Because some people only use it to do (1) and (3), it isn't a tool for (2)."
P.S. I know the author acknowledges this in his own comment on the article.
If you are 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).
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.
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.
Gerrit (and Android's repo) are based on cherry-picking and rebasing, not branching and merging. They will turn your history into a mess in any non-trivial setting. It also doesn't support Git submodule trees.
What the original article author wants is some kind of security. Git's way of doing that is GPG signatures.
My advice: if you have a choice, do NOT use Gerrit for anything. GitHub is gazillion times better.
(note: we might not be using the latest version of Gerrit, however it's so bad that I don't think a new version will help)
It's true that Android uses a lot of cherry-picking and rebasing, but that's because they have to support a large number of releases. That's a development process choice that the Android folks have made --- but it's not fundamental to Gerrit.
At least the modern versions of Gerrit have a lot of configuration options, some of which can be set on a per-user basis (via ACL settings). It's certainly not perfect, but it is actively being developed, and it is getting better...
What I'd really want to do in this situation is to have a feature branch where I push another commit for review. The difference is clearly visible and I can get new review comments without losing the old ones. This works very well with Git and GitHub.
http://review.couchbase.org/8560
I pulled this one arbitrarily, it just happened to be the top. It's got a dependency and they change together. It works flawlessly and almost entirely transparently as long as you have a Change-Id (for which there's a simple hook to generate). git config receive.denyNonFastForwards true
This will permit branches to only go in a forward direction.GIT was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.