Git Rebase…be careful

by Katherine Akey / from beautifuldecay.com

I was reading about git command rebase x merge because I was trying to figure out new better ways to work with these commands and I found an email from Linus Torvald where he is commenting about it.

In this email, Linus Torvald says:

You must never EVER destroy other peoples history. You must not rebase commits other people did. Basically, if it doesn’t have your sign-off on it, it’s off limits: you can’t rebase it, because it’s not yours.

Rebase command destroys the history of commits and we have to be careful about it. We must never use rebase command on other people’s trees, simply because it’s not ours and we don’t have right to destroy other people history. In this email, Linus says too that we must never use it on public trees, even if it’s ours, because it’s public and someone maybe is using it.

People can (and probably should) rebase their _private_ trees (their own work). That’s a _cleanup_.

On other hand, rebase should be used to clean our private trees and organize our public commits. Only private/local trees =D!

So, Other people’s tree or public tree? Don’t use rebase, just merge! Private tree? You should use rebase to clean your mess!

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )

w

Conectando a %s