Alex
Alex

Reputation: 7612

Fixing git-svn "File or directory is out of date; try updating"

I'm using git svn to be able to keep on working with Git locally, but push changes to an SVN server remotely.

I did a git svn fetch before doing git svn dcommit.

However, now the latter command gives back

Merge conflict during commit: File or directory 'src/path/to/Images' is out of date; try updating: resource out of date; try updating at /usr/libexec/git-core/git-svn line 939

I'm working in the Terminal application.

Any ideas about what I could do? Thanks.

Upvotes: 3

Views: 2648

Answers (2)

Siddharth Bhat
Siddharth Bhat

Reputation: 843

Interestingly, if one has two remotes, say upstream and origin, it appears that the diff occurs against the remote the branch is tracking.

git push <tracking remote> <branch>
git svn dcommit

worked for me.

I assumed that it would diff against my upstream, but it doesn't. It diffs against origin, since that's the remote the branch is tracking by default.

Upvotes: 0

Peter Bratton
Peter Bratton

Reputation: 6408

Try using:

git svn rebase

instead of

git svn fetch

to prepare your code for submission to SVN. Subversion can only accept new commits, so git-svn must arrange your changes such that they are a sequence of new changes to SVN, and you need to rebase for that.

Upvotes: 4

Related Questions