7

I am new to SVN.

I found a conflict message as shown below:

rahulv@SWS306:~/sp/s2$ svn status
M       Gemfile
M       Gemfile.lock
M       config/intializers/secret_token.rb
D     C tmp
      >   local dir unversioned, incoming dir add upon update
D       tmp/cache
?       tmp/data
D       tmp/pids
D       tmp/sessions
D       tmp/sockets
Summary of conflicts:
  Tree conflicts: 1
rahulv@SWS306:~/sp/s2$

The issue occurred after updating using 'svn up' command.

How to fix this issue?

webster
  • 3,902
  • 6
  • 37
  • 59
  • @bahrep, oops, my mistake then. I thought most Rails people use git rather than svn. – roob Dec 18 '14 at 10:25
  • Duplicate of http://stackoverflow.com/questions/3985504/svn-how-to-resolve-local-add-incoming-add-upon-update-on-a-folder – reinierpost Apr 06 '16 at 07:36

2 Answers2

15

I had this issue today, and because I didn't want keep the current contents of the new versioned directory, simple solution was:

svn status      # review current situation
svn revert tmp  # fix, replace tmp with right path for you
svn status      # verify there are no conflicts any more

Of course, if there's any doubt that the existing non-versioned directory contains anything valuable, copy that elsewhere first (and then possibly add to SVN after reverting, if those files should be under version control).

hyde
  • 60,639
  • 21
  • 115
  • 176
  • great answer, but I want to keep the incoming changes. Any idea how to do the opposite and override the local file? – SM3RKY Jan 27 '16 at 01:48
  • 1
    @SM3RKY What do you mean? This will overwrite any local changes (which is why I suggest copying anything valuable elsewhere). The usual svn update should then get the version you want, as usual. – hyde Jan 27 '16 at 05:15
5

The error message in the status output says it all:

> local dir unversioned, incoming dir add upon update

That means that you had a tmp directory created in your working copy using mkdir but did not add it to the repository (yet), although you probably already added it locally using svn add. When running svn update, from the repository a different tmp directory is checked out, which will overwrite your tmp directory unless you fix this issue.

As a rule of thumb, try not to work on the same parts of a project in a single branch/trunk with other people, as this will eventually cause merge conflict headaches of unheard proportions.

The following SVNBook chapters are a must read:

bahrep
  • 29,961
  • 12
  • 103
  • 150