Git 分享下如何搜索 github forks 里的 commits

haiguizac · October 16, 2013 · 3753 hits

我经常碰到这个问题,想在一个 github repo 的 forks 里搜索,看有没有想要的东西。有的话就不用我费心去写了。不知道有没有跟方便的办法,不过下面的方式觉得还可用。

是用英语写的。估计大家都能看懂就不翻译了哈。

1) git clone main repo

2) in cloned folder, fetch all commits using script from https://gist.github.com/zaczheng/7003545

3) search in forks(excluding main author) for patterns in i) commit message git --no-pager log --format="%h %cd %ae %s %b" --grep= | grep -v

ii) in commit itself(i.e. code) git --no-pager log --format="%h %cd %ae %s %b" --S | grep -v

iii) extras: add other stuff like --since, whatever. man git-log for options.

4) If found, cherry pick it! Otherwise, cry and get down to coding it yourself.

发布了一个 gist: https://gist.github.com/zaczheng/7003857

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.