change svn working copy to another directory - macos

Q: So I have local svn setup on my mac. I want to change to working copy of a repository to another folder without 'svn checkout', so that I can commit some code that is not currently in the working copy.
Problem with 'svn checkout'
The reason I don't want to use 'svn checkout' is b/c I don't want to overwrite the code into the new folder designated for working copy, because when I move the new code into the new designated folder and do an svn commit, I get an error based on the .svn hidden folders that svn attaches to your committed code.
What I am trying to accomplish?
I got myself into this mess, b/c I am trying to add multiple versions of my code into different folders, so that I can compare them against one another.
Thanks, Jon

You can use "svn copy" to copy one or more files in a working copy or in the repository.
More details: http://www.visualsvn.com/support/svnbook/ref/svn/c/copy/
I hope it helps.

When you do a svn checkout, it does not delete and overwrite existing files - it merges them (try it - make a backup copy of your target directory and then svn checkout into it).
However, the simplest way is to svn checkout into a clean directory, then copy your files on top of the checkout. Rename your current directory to something else if you need to keep the directory name for your checkout.

Related

git automatic add and remove?

so to add a file I need to run git add and to remove a file git remove
but this seems to be a very time consuming job if the project has a lot of files that change on my local copy and then the remote repo needs to be updated.
is there some automatic way to sync the local repo with the remote one, like in the GUI version of git? the gui vesion automatically adds new files and removes deleted files
You can use git add -A. It works on your entire working copy and stages (adds to the "Changes to be committed" section) all new (not ignored), modified and deleted files.
There are GUIs available that may help you add files in bulk. I have used Atlassian SourceTree with some success. However there are ways to add multiple files easily from the command line.
You can use wild cards to add multiple files (i.e. git add CurrentDir/*.c to add all the .c files in the current directory. There are more examples of using wildcards in the git documentation.

How To Re-Locate Working Copy In SourceTree

I have a repository added to SourceTree. When I commit a change to the remote repository through XCode I see the change get committed remotely but my working copy doesn't get updated in SourceTree app. I have to rebase the changes to master in SourceTree. This is because my working copy folder is set to the wrong location in SourceTree.
How can I change the location of the local working copy folder in SourceTree?
The easiest way is to move your old Working Copy (rename the folder).
When you start SourceTree next time, SourceTree wants you to set the new "Working Copy" folder of the repository.
https://answers.atlassian.com/questions/43326/change-working-copy-location
Another way is to adjust the entry in sourcetree's bookmarks xml file
%localappdata%\Atlassian\SourceTree\bookmarks.xml
e.g.
C:\Users\Qwerty\AppData\Local\Atlassian\SourceTree

How to checkout a subfolder from a local svn copy (and not the svn server)?

For some simple Windows batch script, I want to temporarily create a copy of a certain folder in an local working copy of an svn repository at a certain revision. I do not want to checkout directly from the svn server (because then my script needs to know what the server address is, and potentially I would need to authenticate etc.)
And I can not just copy the subfolder, as the hidden .svn folder is higher up.
I have been trying some variations on (with the repo folder containing the .svn hidden folder):
svn co file:///E:/repo/paper#48 E:/temprepo
But that doesn't work. My Windows 7 command prompt answers with
svn: E180001: Unable to connect to a repository at URL 'file:///E:/repo/paper'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///E:/repo/paper'
I am doing something wrong, or is what I am trying impossible?
Your question seems bit ambiguous. I can think of two ways of looking at this.
Assuming you just want a copy of a sub-folder in a svn working copy WITHOUT the .svn folders.
You can use svn export to copy a given sub-folder of a working copy like this - svn export E:\repo\paper E:\temprepo.
Quote:
And I can not just copy the subfolder, as the hidden .svn folder is
higher up.
EDIT: This file structure is only available in subversion v 1.7. In a subversion client with version 1.6.x sub-folders in a working copy should be self-contained. Meaning you may duplicate it to another place, and do subversion operations like svn update etc. in it.
As you have rightly mentioned in your question, you have working copy of subversion repository and not the repository it self.
You can check out only for a repository that happens to be your subversion server.
When you check out your repository, a pristine version of the repository contents are located inside the ".svn" folders.
This is how svn shows you the diff when your working copy differs from the original contents without routing it's request to server.
It also keeps meta data of your server address and other information which you can see when you do svn info. This also contains your server address as svn url.
Your working copy and the ".svn" folders fully recognize the repository from which it was checked out.
I hope you have understood why you can not checkout from your own working copy.

Create git repository after project creation

I know there's an option to make a local repository for your project when you first create it, but is there an option create a repository after you've created your project?
Sure, just run the following command in your project directory:
git init
This will create the .git directory containing an empty repository. Then, add and commit your files.
In the command prompt, make sure you're in the desired directory and perform a git init and you will have created an empty repository.
You can then proceed to add the files and directories to the repository by doing
git add <filename1> <filename2> ...
or you can select whole directories and use * to act as a wild card of sorts.
git add ./*
If you have any more questions check out these pages:
http://gitref.org/creating/
http://gitref.org/basic/#add
Hope this helps.
You should go to your Xcode menu, click Source Control > Create Working Copy...
Xcode will automatically create your .git folder repository.
Good luck, and make sure you have a backup of your project before trying something else.

Building Qt once added to subversion?

I need to make some changes to Qt 4.7.1, so I need to add it to my subversion server to track my changes. However, once it's added, the configure script fails. I'm guessing it's choking on the .svn files.
I'm using Windows. Is there any way to add Qt to subversion, delete all the .svn folders, configure and build it, recreate the .svn folders, and then submit my changes?
Or is there any other work around? The error I get is 'Couldn't update default mkspec'
Here is what I would have done:
Install Qt in some folder.
Make sure that auto-props and global-ignores are set up properly.
Rename the whole folder.
Create an empty repository.
Create an empty folder having the same name as the original one.
Import the empty folder into the repository.
Remove the folder.
Check out the folder.
Copy the contents of the backup to the working copy.
Carefully add everything you want to be source controlled, probably using the -N or --depth options.
Put everything else into appropriate svn:ignore properties.
Commit.
Compare the working copy and the backup.
If there are any differences, wipe both the working directory and the repository, then repeat from the step 2, correcting the mistakes.
It may seem a bit of overkill, but importing such a large project into an SVN repository isn't a trivial task.
The problem is if .svn folders exist in /mkspecs/default and /mkspecs-win32-msvc2008 then configure fails to run with the error 'Couldn't update default mkspec'
If I move the .svn folders, configure, then replace them, I can then build.

Resources