On Wed, 25 May 2011 23:32:42 -0700 (PDT)
paymaster <baekseon...@gmail.com> wrote:

> I want to know history of branch..
> 
> if someone deleted branch... or made branch...

This is a somewhat complicated topic.

First, there's a question about what precisely do you count as creation
and deletion of branches: branches can be created or deleted in a local
repository due to the user running something like `git checkout -b
newbranch` and `git branch -D oldbranch`, or branches can be created or
deleted in a remote repository due to the user doing `git push`.

If you're talking about this case, then the general answer is no:
branches and tags are merely files under the Git's data directory
(".git" in non-bare repos) and they are not versioned.
On the other hand, non-bare repositories by default have
a facility called "reflog" [1] turned on. This can't show you who and
when deleted a branch, but usually you can recover a deleted branch by
checking out an appropriate reflog entry.

Second, contrary to commits which have strong identity (their author,
committer, timestamp etc recorded with them), branches and tags are not,
and this was intentional as only graphs of commits represent real
history, and branches/tags are only helpers to reference particular
commits.  Hence maybe you should rethink your approach to Git's data
model entirely and stop putting too much sense into branches and tags.

Third, it's quite possibly that you're trying to recover from a
situation resulted from someone (inadvertently) removing a branch from
a "central repository" everyone syncs to.

In this case you should probably either look at Git hooks [2] which
allow you to perform various actions when someone pushes to the
repository (so you can at least log what happens) or turn to more
involved "server-side" solutions like gitolite [3] or gitosis--they
allow you to control who can do what just by editing certain
configuration files.

1. http://www.kernel.org/pub/software/scm/git/docs/git-reflog.html
2. http://www.kernel.org/pub/software/scm/git/docs/githooks.html
3. https://github.com/sitaramc/gitolite

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to