Re: [AMBER-Developers] URGENT: weird commit to master branch at

From: Jason Swails <>
Date: Fri, 20 Apr 2012 10:24:45 -0400

On Fri, Apr 20, 2012 at 10:12 AM, Daniel Roe <> wrote:

> I have two separate copies of the git repo, and the last commit I have
> in both masters is 'e786ee21de003a808052386466481623a5bfed2e' (the
> first one that is discarded in that message), and the last time I

I confirm this is the last commit I have in my tree. I also did a git pull
last night, and based on emails only the spfp-dev has been pushed to since
then. I'm guessing what happened is someone did a

git push -f/--force

Here's what man git-push has to say:

       -f, --force
           Usually, the command refuses to update a remote ref that is not
an ancestor of the local ref used to overwrite it. This flag disables the
           check. This can cause the remote repository to lose commits; use
it with care.

This sounds exactly like what happened. In general, please nobody use "git
push -f". Some git versions will push to all tracked branches by default
(i.e., if you have master and adqmmm-dev on your local repository both
tracking the corresponding repos from master, a "git push" while you are on
master will push both adqmmm-dev and master, even though you are not on
adqmmm-dev at the moment). Therefore, "git push -f" may affect more
branches than you expect (e.g., master).

It is better to be explicit if you need to rebase a branch. Do something
like this:

git push <remote> <commit_id>:<branch>

This will set the HEAD of <branch> on the <remote> (often origin) to the
commit <commit_id>. I've never actually seen the need to use a "git push
-f" before, so it can probably be avoided in general.

All the best,

Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
AMBER-Developers mailing list
Received on Fri Apr 20 2012 - 07:30:07 PDT
Custom Search