문제

The following monstrosity very nicely found a git stash containing the word Upload which is what I was looking for:

git fsck --no-reflog | awk '/dangling commit/ {print $3}' | \
while read ref; do if [ "`git show -p $ref|grep -c Upload`" -ne 0 ]; then echo $ref ; fi ; done 

Is there a prettier version of this? I guess the pickaxe should work but git log -g doesn't see this commit.

도움이 되었습니까?

해결책

... but git log -g doesn't see this commit

Commits that are (still) referenced by the reflog are considered reachable and not dangling. Thus running git log –g is contrary to what you wanted, so no surprises here.

Commits will be reachable via reflog for the gc.reflogExpire timespan, with a default of 90 days.

Is there a prettier version of this?

No, git fsck is the right way for accessing dangling commits.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top