On Dec 27, 2012 3:07 PM, "Vincent van Ravesteijn" <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.  As long as you don't gc a repo...  But even so, it's best to not
have to go look in the reflog, and a few simple rules help with this:

- never do non-fast-forward pushes to branches others might ever
legitimately pull from;

- never push branches to an official repo that you don't want the public to
see or use;

- never delete anything from official repos;

- keep dev work on separate repos;

- for dev branches, if you rebase then first create a copy of the branch
and rebase the copy, not the original;

- delete dev branches only when you're really done with them and they are
just cluttering the output of git branch;

- only use tags for official repo purposes, never tag in local clones
(there's only one tag namespace, whereas branches have per-remote
namespaces);

- just don't garbage collect you're repos.

Nico
--

Reply via email to