Is there a way to determine when a Git branch was created? I have a branch in my repo and and I don't remember creating it and thought maybe seeing the creation timestamp would jog my memory.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
Try this
First, if you branch was created within
gc.reflogexpire
days (default 90 days, i.e. around 3 months), you can usegit log -g <branch>
orgit reflog show <branch>
to find first entry in reflog, which would be creation event, and looks something like below (forgit log -g
):You would get who created a branch, how many operations ago, and from which branch (well, it might be just "Created from HEAD", which doesn't help much).
That is what MikeSep said in his answer.
Second, if you have branch for longer than
gc.reflogexpire
and you have rungit gc
(or it was run automatically), you would have to find common ancestor with the branch it was created from. Take a look at config file, perhaps there isbranch.<branchname>.merge
entry, which would tell you what branch this one is based on.If you know that the branch in question was created off master branch (forking from master branch), for example, you can use the following command to see common ancestor:
You can also try
git show-branch <branch> master
, as an alternative.This is what gbacon said in his response.