Op 27-12-2012 23:27, Nico Williams schreef:
On Dec 27, 2012 3:07 PM, "Vincent van Ravesteijn" <v...@lyx.org
<mailto:v...@lyx.org>> wrote:
> You can correct almost everything with git. Just don't push a wrong
tag, ...
Right, because deleting a branch or tag, or making a branch name refer
to a completely different line of commits (e.g., rebase) are
destructive operations, but a) the commits remain in the repo, b) the
reflog will track these actions and let you find the old commit
hashes, and that's enough to recover.
It's just "not done" to change a tag, because people should be able to
trust the tags... (according to the git documentation)
As long as you don't gc a repo...
Luckily git runs the garbage collection itself, but you should *never*
lose anything, because gc is very careful.
But even so, it's best to not have to go look in the reflog, and a few
simple rules help with this:
- for dev branches, if you rebase then first create a copy of the
branch and rebase the copy, not the original;
Huh, you will end up with tons of copies of the same branch, just
because you rebase them once in a while ?
- just don't garbage collect you're repos.
This is done automatically (if you don't change some settings). Besides
that, it cannot hurt.
Nico
--