29 questions
1 vote
0 answers
41 views
Is it possible for a git pretty format to show the reflog selector with BOTH the "index format" and the "timestamp format"?
The git reflog command (or git log -g) can use a custom "pretty format". A ton of things are customizable in the pretty format. But although the reflog designator %gd can take two formats, ...
1 vote
1 answer
141 views
Permanently delete a specific commit/stash from Git
I have an automated process that creates a temporary commit and stash, does some stuff, and then pops the stash and reverts the commit. After doing this a few times, the automated git gc complains ...
2 votes
0 answers
337 views
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 ...
2 votes
2 answers
1k views
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 ...
0 votes
1 answer
106 views
Can an admin access my reflog to revert commit changes?
I recently made a commit and it was incorrect so I tried to reset it to another commit. Now I'm realizing that the commit had information we needed for our team. Can the GitHub organization's admin ...
1 vote
2 answers
1k views
Can `git reset --soft` be used to undo secrets from a commit before pushing to a remote (Github)?
Suppose I have a git repo with app.py and I accidentally include an API key (or other secret) as plaintext in app.py in a commit that I have not yet pushed to a remote (lets say on Github). To undo ...
0 votes
2 answers
344 views
Solving git upstream rebase "hard case"
Wouldn't the git upstream rebase "hard case" problem be solved if each branch carried a reference to its initial base commit (say branch@{base}) ? This initial base commit (stored under ...
3 votes
3 answers
3k views
git - fatal: your current branch appears to be broken (possibly from interrupted pull)
Problem: accidentally did a git --amend and pushed it to a usb key from first computer pulled from the usb key to a second computer second computer repository is now corrupted git pull to first ...
2 votes
1 answer
140 views
Why git commit can be lost in this case?
My colleague did a series of careless pull/push operations. He end up in a situation where his local commit becomes missing I recovered his commit using git reflog. But I couldn't figure out why his ...
3 votes
2 answers
1k views
why doesn't my git reflog go back up to clone
I have a question about git reflog: at the beginning of my project, when I did a git reflog, I was able to see all the steps up to my original git clone command. Today, git reflog no longer goes ...
4 votes
2 answers
280 views
Viewing expired reflog logs
Is there any way to view expired reflogs? I've been keeping a few local commit I made months ago on a local branch and I've kept it up to date with our remote branch by rebasing frequently. Somehow I'...
4 votes
1 answer
99 views
What should "git reflog show <ref>" show?
I have two branches, master and b1. When I'm on b1, 'git reflog show' displays all the changes to b1. However, after I switch to master and run 'git reflog show b1', it displays something different. ...
1 vote
1 answer
2k views
Getting full commit history after git clone
I'm the lone developer on a project where I'm working across multiple computers, some on VM. After doing a git clone of my repo on gitHub, calls to reflog only show items after the clone. How can I ...
1 vote
2 answers
2k views
Can't recover commit from Git due to same sha in reflog
I'm trying to recover code because I accidentally switched to a branch in eclipse and lost all my data, somehow (I still don't know what I did). When I open up my git reflog in command line, I see: ...
19 votes
10 answers
25k views
unstaged files gone after git reset --hard
I tried the git reset --hard HEAD@{n} from git reflog and I lost everything with my current unstaged files :'( the unstaged files is the last git add I did, before then I tried git reset to the last ...