crash mid rebase -- now fatal error

168 views
Skip to first unread message

smichr

unread,
Jul 15, 2012, 12:13:24 AM7/15/12
to sy...@googlegroups.com
During a rebase, the computer just shut down (like the battery failed even though there was about 50% power left). Now after restarting I cd to sympy and cannot do anything. I get this message whenever I issue any git command:

chriss@CHRIS-LT ~/sympy ((...)|REBASE)
$ git log
fatal: Not a git repository (or any of the parent directories): .git

chriss@CHRIS-LT ~/sympy ((...)|REBASE)

Any ideas of how to remedy this? (The first page of google suggestions for my search have not been fruitful.)

/c

Aaron Meurer

unread,
Jul 15, 2012, 12:35:16 AM7/15/12
to sy...@googlegroups.com
Restore from backup, if you have one.

Otherwise, you'll have to figure out what part of the .git directory
got messed up.

If you can't figure it out, and you've pushed everything to GitHub,
you can get a fresh start from there.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/AO5pjMv34CsJ.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.

Aaron Meurer

unread,
Jul 15, 2012, 12:36:47 AM7/15/12
to sy...@googlegroups.com

Chris Smith

unread,
Jul 15, 2012, 1:58:43 AM7/15/12
to sy...@googlegroups.com
On Sun, Jul 15, 2012 at 10:21 AM, Aaron Meurer <asme...@gmail.com> wrote:
> https://git.wiki.kernel.org/index.php/GitFaq#How_to_fix_a_broken_repository.3F
> may also be useful.

mv sympy bad
mkdir sympy
git clone git://github.com/sympy/sympy.git
cd sympy
cp .git/config config_bak
cp ../bad/.git/config .git/config

Then I pulled in all my pushed work. Perhaps I'll see what is
different about the bad sympy repo and the good one, but for now this
got me back on track.

/c

smichr

unread,
Mar 4, 2013, 9:45:42 PM3/4/13
to sy...@googlegroups.com
Here is the ticket:

cp .git/ORIG_HEAD  .git/HEAD
rm -f .git/index
git reset
git rebase --abort

(at least that is the best that I've been able to do so far)

Joachim Durchholz

unread,
Mar 5, 2013, 1:42:27 AM3/5/13
to sy...@googlegroups.com
Removing the index seems like a good way to kill any git repo.
I'd simply start over with a new clone, copying the working directory
over to salvage any uncommitted work. The unpushed commits would be
gone, not sure how much of a problem that would be.

Regards,
Jo

smichr

unread,
Mar 7, 2013, 12:19:55 AM3/7/13
to sy...@googlegroups.com
I also ran into a problem where something happened during a rebase and I couldn't abort the rebase. The solution for this is at http://stackoverflow.com/questions/5104649/how-to-abort-an-interactive-rebase-if-abort-doesnt-work where you have to substitute your branch name for "master" in the solution, so if you are trying to rebase foo and get this problem you fix it with 

git update-ref refs/heads/foo expected_SHA1





Reply all
Reply to author
Forward
0 new messages