我可以这样做:
git branch -a | xargs -L 1 bash -c'echo'$ 1`git log --pretty = format:%H%an$ 1 ^ .. $ 1`'_然而,这会返回每个分支的最后一个提交者,而不一定是创建分支的人。 方案
分支只不过是一个提交指针。因此,它不会跟踪谁创造了我等元数据。你自己看。在你的仓库中试试 cat .git / refs / heads /< branch> 。 '真的在跟踪存储库中的这些信息,请查看分支描述。它们允许您将任意元数据附加到分支,至少在本地。
另外 DarVar的答案在下面是非常聪明的方式来获取这些信息。
I want to find out who created a branch.
I am sort-of able to do so with:
git branch -a | xargs -L 1 bash -c 'echo "$1 `git log --pretty=format:"%H %an" $1^..$1`"' _However, this returns the last committer per branch, not necessarily the person who created the branch.
解决方案A branch is nothing but a commit pointer. As such, it doesn't track metadata like "who created me." See for yourself. Try cat .git/refs/heads/<branch> in your repository.
That written, if you're really into tracking this information in your repository, check out branch descriptions. They allow you to attach arbitrary metadata to branches, locally at least.
Also DarVar's answer below is a very clever way to get at this information.
更多推荐
找出git分支的创建者
发布评论