Questions tagged [git-reflog]

For issues relating to the git-reflog command to manage information recorded in reflogs.

git-reflog is a command to manage the information recorded in the reflogs.

Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository.

Syntax:

git reflog <subcommand> <options>
89 questions
2
votes
2 answers

Is it possible to see if a commit has been deleted from a remote branch?

The reason I am asking this question is that I suspect that occasionally where I work sometimes a commit seems to just "disappear" from a remote branch for no reason. I have seen in a different post on here that indeed this is possible to do…
GatorGuy023
  • 297
  • 2
  • 3
  • 11
2
votes
0 answers

Scope of gc prune and git reflog expire, and related config

We are using throwaway integration branches which are pushed, and then later deleted and recreated. However the discarded branches are leaving dangling commits and trees which I can view with this command: git fsck --unreachable --no-reflogs I could…
user2104419
  • 45
  • 1
  • 5
2
votes
3 answers

what happened to a commit that doesn't show up in any branches but available in "git show"

I have a commit id available in the bare repo. git show commit id, shows the commit with the changes. But the same commit doesn't show up when using the below commands git branch --contains or git reflog show --all | grep
Senthil A Kumar
  • 10,306
  • 15
  • 44
  • 55
1
vote
2 answers

How to restore deleted commits on pythonanywhere

I have accidentally deleted my commits on pythonanywhere.com and now I see very old state of my files. My Django website isn't working at all. What I did: $ git reset --hard HEAD~1 And then: $ git push --force That was big mistake. I deleted…
Percival
  • 21
  • 5
1
vote
0 answers

How can I use `git reflog format` while showing it as sorted by date?

I want list use git reflog format, and show it as sorted by date with (--date=relative) flag. git reflog --format='%C(auto)%h %<|(17)%gd %C(blue)%cr%C(reset) %gs' has following output: $ git reflog --format='%C(auto)%h %<|(17)%gd…
alper
  • 2,919
  • 9
  • 53
  • 102
1
vote
1 answer

Share full git repository

There are many topics on bundle and unbundle repository, but I cannot find a way to restore it with reflog. git bundle create mybundle --all Now git clone mybundle clears reflog and git init && git bundle unbundle mybundle does... nothing? Could…
kosciej16
  • 6,294
  • 1
  • 18
  • 29
1
vote
2 answers

remove single git reflog entry by hash/id

I committed sensitive data to a single file on my main branch. I never pushed it. I can change HEAD to point to the previous commit with git reset HEAD^, but the commit is still hanging around as git reflog shows. How can I use the reflog hash/ID,…
nmz787
  • 1,960
  • 1
  • 21
  • 35
1
vote
0 answers

Git command within GitHub

In one of my repositories on GitHub, some commits are missing. I am pretty sure about it: and clicking on the link "11 commits" yields a page with the message "No commits found for ". A possible cause is a --force commit that overwrote other…
Ivan dal Bosco
  • 3,233
  • 4
  • 19
  • 24
1
vote
2 answers

Undo Gerrit push on GitLab

I've accidentally done a Gerrit style push on a GitLab repo. That is, while on my local branch I did: $ git push origin HEAD:refs/for/master Enumerating objects: 7, done. Counting objects: 100% (7/7), done. Delta compression using up to 8…
Toby
  • 9,696
  • 16
  • 68
  • 132
1
vote
2 answers

undo git reset --hard, how to do it?

My uncommitted files deleted by git reset --hard command. How can I recover? I tried git reflog etc but it stays at 0%. Checking object directories: 100% (256/256), done.ories: 0% (1/256)
1
vote
1 answer

Restoring an Xcode commit that was never pushed to Github

This is a question that I posted, and then after much digging finally resolved myself. There is actually quite a bit on this subject both on this forum and elsewhere, but it usually requires some familiarity with Terminal. I am going to describe the…
TJ Rogers
  • 500
  • 1
  • 6
  • 19
1
vote
2 answers

Is there a canonical way to retroactively split a git repo into a public and private variant?

I have a git repository containing files which have some sensitive data possibly hardcoded, or formally hardcoded and now residing at some points in the git history. In the interest of making the project publicly available so programers with similar…
awiebe
  • 3,758
  • 4
  • 22
  • 33
1
vote
1 answer

Reference a the state of HEAD before the last `pull` or `merge`

I find that I often do this. Run git pull or git pull --rebase Look at the standard output to see the changes From github.com:foo/bar 3d8749e..b795f99 master -> origin/master Copy ’n’ paste this version range to git log -p…
Joachim Breitner
  • 25,395
  • 6
  • 78
  • 139
1
vote
1 answer

Find deleted commits by date

I know I commited some important changes to my repo the 1st of January of 2017, after that I've done some work but I've also accidentally deleted some commits. Is it possible to recover or view deleted commits from an specific date, for instance,…
Dalvtor
  • 3,160
  • 3
  • 21
  • 36
1
vote
2 answers

git fetching 'lost' commits

Short version: Is it possible to use 'git fetch' to get commits from a remote repo that are not visible in the git log (part of/under the HEAD commit) Longer version: I have a repo (remote copy) that looks like this: A - B - C - D(HEAD) \ …
JohnGreth
  • 41
  • 4