How do I keep Resharper Files out of SVN? - visual-studio

I am using VS2008 and Resharper. Resharper creates a directory _Resharper.ProjectName. These files provide no value for source control that I am aware of and cause issues when committing changes. How can I get SVN to ignore them? I am using TortoiseSVN as my interface for SVN.
EDIT: You guys are fast.

Here's a link to show the ignoring process in TortoiseSVN

Add the file names (or even the pattern _Resharper.*) to the svn:ignore property for its parent directory.

Gonna post an answer to my own question here as I read the manual after I typed this up. In TortoiseSVN, goto settings. Add
*ReSharper*
to the "Global ignore pattern". Adding items to the global ignore pattern means that these files will be ignored for any project you work on for the client with TortoiseSVN installed, so it might not be appropriate to use the global ignore in all cases.
You can also add specific files and directories to the ignore list for individual projects if you select this from the TortoiseSVN menu BEFORE they have been added to your repository. The "BEFORE" part is what tripped me up originally. Since this is a single developer project, I've been checking in binaries, etc. b/c it has no consequence for other developers, and the Resharper files got in there.

Store Resharper caches in system temp folder.
Check First setting page in r#.
Environment -> General -> System -> Store caches ..

Short answer: the "svn:ignore" property
Long answer:
# cd /your/working/copy
# export EDITOR=vi
# svn propedit svn:ignore .
(add "_Resharper.ProjectName" on its own line and write the file out)
Edit: erg... doh, just realized you said tortoise... this is how you do it with the command-line version of SVN

svn has an "ignore" property you can attach to a filename pattern or a directory. Files and directories that are ignored won't be reported in "svn st" commands and won't go into the repo.
Example: you have C source code in .c and .h files, but the compiler creates a bunch of .o files that you don't want subversion to bother telling you about. You can use Subversion's properties feature to tell it to ignore these.
For a few files in one checked-out working directory, for example myproject/mysource/
bash> svn propedit svn:ignore mysource
In the text editor that pops up (in linux, probably vi or whatever your EDITOR env var is set to), add one filename pattern per line. Do not put a trailing space after the pattern (this confuses svn).
*.o
*.bak
That's all. You may want to do a commit right away, since sometimes svn gets fussy about users making too many different kinds of changes to files between commits. (my rule is: if in doubt, commit. It's cheap)
For a type of file appearing in many places in a sprawling directory tree, edit the subversion config file kept inside the repository. This requires the repository administrator's action, unless you have direct access to the repository (not through svn: or http: or file:, but can 'cd' to the repository location and 'ls' its files). The svn books should have the details; i don't recall offhand right now.
Since i don't use Tortoise, i don't know how directly the description above translates - but that's why we have editable answers (joy!)

This blog post provides a example on how to do what you want on via command line svn.
http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/
These change will be reflected in TortoiseSVN.
I believe there is a way to do it via tortoise however i don't have a windows vm accessible atm, sorry :(

SVN only controls what you put into it when creating your repository. Don't just import your entire project folder but import a "clean" folder BEFORE doing a build. After the build you get all the object files or your _Resharper folder etc. but they are not version controlled.
I forgot: the svn:ignore command is another possibility to tell SVN to exclude certain files. You can add this as a property to the version controlled folders, e.g. with TortoiseSVN.

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.

Working copy location of xCode SVN repository

Reference version: xCode 4.5.2
In Organizer-Repositories I see for each repository a "Root" folder and one or more folders related to the root. How I can see the working copy location related to each folder?
By right-clicking the folders I see only the link to the help and no options to see the actual location of the directory on my computer.
The reason why I'm asking this is that I added folders in my repository from different locations in my local filesystem. Now I need to find all the locations, remove them and put my working copy in a single directory tree to avoid mixing SVN working copy files with non-versioned files.
Many thanks for the help.
The xCode-Repositories interface for SVN seems incomplete (as appears from other questions/answers on it).
So I've resolved by removing the repository from xCode interface and re-creating it.
I now use "xcrun svn ..." command line interface for all the operations except the simple checkout/commit commands.

Preventing certain things from being committed in XCode

Situation: I have a few things in my code repository that I only want to be in my own working copy, but I still want to be able to modify the rest of the codebase and do commits without putting in those certain things I mentioned. Is it possible to lock those down in some way so they do not go in with the rest of my commit? Right now XCode commits everything that was modified. I realize I could commit files individually but it would be nice to continue to use the global commit.
Why not try the svn:ignore property (about half-way down the page)?
Maybe you could change the status of files to locked, then commit them without locked files.
For SVN help, pls reference to http://svnbook.red-bean.com/en/1.5/index.html.
You should comment in "global-ignores" line in the configuration file located in ~/.subversion/config.
By this way you could ignore file types that you have given. I use the following set:
global-ignores = *.o *.lo .la ## .*.rej .rej .~ ~ .# .DS_Store *.mode1v3 *.pbxuser
Hope this helps.

How to add a new project to source control in Xcode 4?

How do I add a new project to source control (SVN) using Xcode 4?
Open Organizer. Click on the root of your SVN repository in the tree on the left. Click on Import on the bottom right and choose the directory from finder that you want to add and click Import.
This will add the project to SVN
The XCode 4 documentation recommend using command-line tools or a utility program to set up a Git or Subversion repository.
To set up a Subversion repository using the command line
1/ Open the Terminal utility and use the svnadmin create command to create a Subversion repository.
For example, if you want a repository named Sketch_svn in the existing location /Users/myUserName/Repositories, you would enter the command:
svnadmin create /Users/myUserName/Repositories/Sketch_svn
Tip: The easiest way to get the full path to a folder into Terminal without risking typing errors is to first type the command (cd in this case), enter a space, and then drag the folder from the Finder and drop it at the end of the Terminal command line.
Note that the directory /Users/myUserName/Repositories/ must already exist before you execute this command. You can use the Finder or a mkdir command to create the directory.
2/ In another location—not in the repository you just created—create a folder to hold a temporary copy of the project. In that folder, create three additional folders named branches, tags, and trunk.
3/ Create a new Xcode project in the trunk folder, using Xcode, or put your existing project in the trunk folder, using the command line or the Finder.
4/ Use the svn import function to import your project into the repository you created and place it under Subversion source control.
For example, if your temporary copy is in /Users/myUserName/Projects/Sketch_tmp, you would enter the following command in Terminal:
svn import /Users/myUserName/Projects/Sketch_tmp \
file:///Users/myUserName/Repositories/Sketch_svn -m "Initial import"
Notes
The backslash at the end of the first line indicates that the command is continued on the next line. You can omit the backslash and type the entire command on one line. If you do use the backslash, be sure there are no spaces following it before you press Return.
There are three forward slashes in the string file:///.
If you type the entire command on one line, be sure there is a space before file:///.
You can include any comment you want in the quotation marks, but be sure your comment will be meaningful to anyone using the repository.
5/ In the repositories organizer in Xcode, click the Add (+) button at the bottom of the navigator pane, and choose Checkout Repository to create a working copy.
Use Terminal. At the command line, you can use the svn import command to add the project to your repository.
From the way you worded your question, I'm assuming that your subversion repository already exists. You'll follow the same basic steps outlined in Add Git or Subversion Version Control to an Existing Project in the Xcode 4 Users Guide, except that instead of creating a whole new repository you'll just add a new directory to your existing repository.
It's handy that Xcode has support for version control, but it's not a full-featured GUI version control client. You should still know how to manage your repository using the svn command line program. Alternately, you can get a GUI front end like Versions. Either way, you should have (and have read) the Subversion Book. There's a lot more to using version control than just checking files in and out, and you need to know how it works and how best to use it if it's going to help you.

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