Sorry that I forgot to say how to do it. The way you did is one way,
but it's too complex. I wrote how to do it here in a comment:
Basically Aaron's post is that he lost some data, because he didn't
know he was doing a rebase. So I replied:
--------------
It’s because you don’t color your prompt with the name of the branch
(and the prompt also changes to something like “master|REBASE” if you
rebase). See here how it looks like:
http://code.google.com/p/sympy/wiki/GitTutorials
so I very, very strongly suggest you use that.
http://blog.ericgoodwin.com/2008/4/10/auto-completion-with-git
e.g. here is my PS1 prompt:
PS1=’${debian_chroot:+($debian_chroot)}\u@\h:\w\[33[31m\]$(__git_ps1
“(%s)”)\[33[00m\]\$ ‘
if you use Mac, source the “contrib/completion/git-completion.bash”
file (in the git repository for git), which contains the definition of
the __git_ps1 and some documentation too (read it if you have troubles
getting it work).
Once you have the colored prompt, I am pretty sure it will never happen again.
-----------------
Ondrej
Ok, start with thing that works, e.g. my prompt, and remove some of
the color changing sequences that don't seem to work in your terminal.
Post here when you figure it out, we'll put it into the documentation,
I plan to overhaul this page soon:
http://docs.sympy.org/sympy-patches-tutorial.html
with videos and updodate info about git. Any help is of course
welcome. :) You can help for example by posting here a prompt that
works etc.
Ondrej
In addition, bash does not expand $variables inside '' but does expand
them inside "". That may be why one source suggested that the $ needed
to be escaped and what Aaron saw.
http://www.gnu.org/software/bash/manual/bashref.html#Single-Quotes
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco