Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git reflog references pruned commits, but does not show the reflog for the branch

Tags:

git

git gc shows:

warning: reflog of 'refs/remotes/origin/abc_branch' references pruned commits

But, when I try to see the reflog, I get nothing:

$ git reflog show origin/abc_branch@{0}

fatal: ambiguous argument 'origin/abc_branch@{0}': unknown revision or path not in the working tree.

I know the syntax is right, because that happened to another branch and I was able to see the reflog - and remove it.

The abc_branch has been deleted on the remote without being merged - commits deleted. I don't want to recover it, I just want to get rid of the warning.

like image 985
Penz Avatar asked Jan 21 '11 16:01

Penz


People also ask

How do I see Reflog?

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.

What is the default setting of git Reflog when no subcommands are specified?

The "show" subcommand (which is also the default, in the absence of any subcommands) shows the log of the reference provided in the command-line (or HEAD , by default). The reflog covers all recent actions, and in addition the HEAD reflog records branch switching.

How do I clean Reflog?

To delete single entries from the reflog, use the subcommand "delete" and specify the exact entry (e.g. "git reflog delete master@{2}").

Does git push Reflog?

Answer is no. Anonymous objects--objects that are only referenced by your reflog--are private to the local repo.


1 Answers

If you just want to get rid of the abc_branch ref, you could try:

git update-ref -d refs/remotes/origin/abc_branch
like image 63
Dave Goodell Avatar answered Sep 19 '22 23:09

Dave Goodell