The true problem with git

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com, or follow me on Twitter.

This is really the core problem with git:

Do not rebase commits that you have pushed to a public repository.

If you follow that guideline, you’ll be fine. If you don’t, people will hate you, and you’ll be scorned by friends and family.

When you rebase stuff, you’re abandoning existing commits and creating new ones that are similar but different. If you push commits somewhere and others pull them down and base work on them, and then you rewrite those commits with git rebase and push them up again, your collaborators will have to re-merge their work and things will get messy when you try to pull their work back into yours.

Users of git have to adopt certain conventions to avoid the perils that the technology allows. If you stick to those conventions, you can avoid the worst problems. But git allows developers to burn themselves badly.

Post external references

  1. 1
    http://git-scm.com/book/ch3-6.html
Source