I'm a fan of the git version control system, but distributed revision control forces you to think a lot more. Today, I ran into a gotcha that I'm documenting to help the next poor schlep.
I'm the only developer working on my web projects, so unless I'm merging changes across forked projects, merge conflicts don't rear their ugly head. I like using
dropbox to keep a naked clone of my repositories, just in case I have disk failures.
My normal procedure is to work on my MacBook Pro, commit to my local git repo, occasionally push to dropbox (no auto hook here yet), and maybe test the code on my Windows machine. Today, when I tried to push my repo to dropbox, I got an error message like this:
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to /Users/me/dropbox/repos/foo.git
If you Google around, you'll see a way around this error is "git push --force." It occurs when you push to a remote repo and then modify the previous commit in some way.
In my case, I used "git commit --amend" after I had pushed. So if you modify commits after they are pushed, expect this kind of "non-fast forward" error.
Comments are closed
1 Comments
Re: Article by Roshambo (2009-02-16)