Is it possible to check the git reflog for all commits to a specific file.
I made a commit to file foo.txt and now it no longer shows in the git history via
git log foo.txt
I want to search the reflog to find all commits to this file so I can find my "lost" commit.
Use git log --all <filename> to view the commits influencing <filename> in all branches.
git reflog directories can be found at . git/logs/refs/heads/. , . git/logs/HEAD , and also . git/logs/refs/stash if the git stash has been used on the repo.
Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository. Reflogs are useful in various Git commands, to specify the old value of a reference. For example, HEAD@{2} means "where HEAD used to be two moves ago", master@{one.
Answer is no. Anonymous objects--objects that are only referenced by your reflog--are private to the local repo.
Came across this while searching for an answer, which is simple: git reflog -- $PATH
, which will include amends and other actions that will not be visible otherwise (though beware, reflog will be pruned by gc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With