I tried to find out how to move my working copy. I know SVN move can be used to move files and folders inside your working copy but what about the working copy itself? I want to move it because I created a branch in a folder location that's different from my branch and had updated therefore all my .NET project references. So when I go to merge back to the mainline trunk I get a bunch of tree conflicts.
I'm runing linux.
The actual working copy directory may be moved at will using your client operating system commands (i.e. Windows Explorer if you're using tortoisSVN). The working copy contains all the meta-data needed to remain consistent with the original repository from which you checked out the local working copy.
Related
I have been working on some code on my mac and want to start working on it on my linux desktop. The project is managed under git. Before the copy, I made sure everything was committed. I then copied the folder containing everything from my mac onto a usb drive, then copied the folder from the usb drive to the linux box. After the copy, everything looks like it is where it should be, but if I do a git status all the files show up as modified. I'm guessing this is because the timestamps on the files have changed. Is their a way to retain the old timestamps so the files dont appear modified? Or to tell git to not worry about changes since the last commit? I'd prefer not to do a git commit -a immediately after the transfer as I dont really want the move of boxes in my git history.
The easiest thing to do is to use clone (rather than copying worktrees around) to share repos.
If you cannot directly clone / fetch / push / pull between the two machines, then you could create a "bundle file" and copy that, instead of copying the actual repo. (See the git bundle` docs or search for existing questions/answers about how to share a repo in this way.)
When crossing operating systems, there are still potential issues. e.g. You'd want to think about how you want to handle line endings if crossing between OS's that have different default line ending rules - but mac and linux shouldn't have that issue anyway.
My new Tortoise SVN repository project should be mix of some files on my local disk and some files already part of another existing project in SVN. Regarding those (existing) files, can I simply copy them using repo browser into new project and then do check out to bring them into local working copy ? Or should I check out existing files to working folder of new project, then add new local files to it and after that add all of them to mentioned new repo project ? Or ... ?
Here are some solutions depending on your application:
if you do not want to duplicate the existing files in the repository: you should use svn:externals property (see Subversion doc and TortoiseSVN doc). This allows you retrieving in the working copy of your new project some folders coming from another location in repository (e.g. from another project). The constraint is that you can do that with entire folders, not separate files.
if you don't matter duplicating the files in the repository: in your local working copy (not in the repo browser), you should select the files you want to copy, right click and choose Context Menu → Copy from the explorer context menu. Then browse to the target folder, right click and choose TortoiseSVN → Paste. Then commit all in once. This is described here.
I am wondering what happens in SVN when a file is updated directly instead of using SVN? The main reason I am asking is that there was a problem updating the SVN on my machine (windows) when the server (linux) had 2 names that were the same, but different case. I resolved this on the server, but didn't do it through SVN since it won't update correct, but I still get the issue. Do I need to run some kind of command to update it?
Thanks.
EDIT:
I deleted the comflicting file in the working direcotry and wanted to know if doing things directory in the working directory get tracked at all or what needs to be done to resync.
When SVN gets blocked because the repository is more "up to date" than the local checkout, one brain dead foolproof solution is:
Move (or remove) the files that are causing the conflict at the command line (don't use SVN tools to do this, and don't use the GUI if you have tortoise installed).
svn update the repository, which will restore the current copy of the files from the subversion server.
Decide what to do with your cached copies of the old files. Either manually merge them back into the repository, discard them, or remake the changes in the new svn managed files (depending on your needs).
Note that if you move the files into a directory using tortoise, make sure that you move it into a directory that's not associated with ANY SVN project. It's not fun trying to undo the helpful changes tortoise does in thinking your wanting a SVN move to accompany the file system move.
There is no need to run any special commands. If you updated the sources, the next time you will run svn update subversion will seamlessly merge the changes and you will get an uptodate working copy.
If you changed some files, they will appear modified or conflicted depending on the changes made by you and other users.
This has been plaguing me for a week.
SVN keeps telling me that a certain file "does not exist in repository".
Fine. Let's just delete it. Forget about it. Ignore it. Whatever. I don't really care about this file (especially if it continues to fail the nightly check-in).
The most bizarre part? A "restore" will actually RESTORE the file from the repository, so its there (corrupted, maybe?).
...and this has to be the icing on the cake. If I delete the file through Windows Explorer, SVN will RESTORE the file from the repository, and right after that state that it doesn't exist in the repository. WTF?
Does anyone have a clue how to get rid of this?
I've already tried clean-ups, reversions, deletions and anything else imaginable, but this one has me stumped.
Thanks for any tips you might have...
It seems most likely that you have corrupted your local working copy, e.g. by moving folders or some other manipulation that you did with windows explorer but should have done through the TortoiseSVN context menu. The information inside the .svn folders now no longer matches the state of the working copy, which is confusing Subversion.
To fix this, delete the parent folder ("Originals") in your working copy with windows explorer (NOT with TortoiseSVN). Then do a TortoiseSVN "update" at the root of your working copy. This should restore the folder in working order.
Another option is to discard your working copy entirely and do a fresh checkout.
Note that the next release of Subversion (1.7) will reduce the opportunities for corrupting your working copy by centralizing all metadata in a single .svn folder at the root.
I've had similar problems with corrupted working copies. Sometimes the working copies have a lot of pending changes but unable to checkin. To resolve this, I use the following approach (svn 1.7+):
Checkout a fresh working copy into a new directory (path2)
In the fresh working copy, if the offending file is there, delete it if needed.
Commit the fresh working copy
In the fresh working copy, delete everything except the .svn directory
Copy everything from the old working copy except the .svn directory into the fresh working copy.
Commit the fresh working copy again
Delete (or backup) the old working copy
Rename the fresh working to the old working copy (path2 to path)
I had faced a similar problem wherein i had a folder, for example "FolderA" which consistently shows in svn update even though I had deleted it.
It would not even show in the folder list but svn would still recognise it as if it exists.
I followed below steps:
1.Create same folder name for which svn was giving error in the same file location
2.Added it to svn checkout. Since it gave conflict errors, i resolved it using the svn option to resolve.
3.Deleted the folder and committed my svn.
Error was resolved
The repository is 1GB big. I need to checkout the repo to 2 PC. Is it possible to use TortoiseSVN checkout a working copy to first PC, then copy this local copy to 2nd PC. Then use TortoiseSVN track on 2nd PC directly? So I can save some time through checking out the repo again under slow network transferring rate.
Also, how do I start version control the copy on 2nd PC? Thanks.
Yes, this works without any problems. Be sure to copy all .svn folders.
Once you copied folder, TortoiseSVN would automagically recognize it and will add menu items in context menu in this folder.
Yes, this works just fine. in fact, you go bit further and use an app like Live Sync to keep the two working copies in sync after the initial copy and both working copies will still work just fine with the SVN repo.
This will work. You can use any SVN client you want with the checkout copy, not just Tortoise.