While viewing the outgoing changes in Eclipse Team Synchronization(Subclipse), I am able to see the unversioned files also, like the generated class files, build folders, etc, which I do not want to see in this view. I dont want to add it to svn:ignore, since I have to do it manually for all the additional folders generated.
Is there any setting to change this to show only versioned files in this mode always?
Tortoise SVN client shows this option while committing, to show only versioned files. I am looking for such an option in Subclipse Team Synchronization view. Thanks in advance.
eclipse_outgoing_view
You should svn:ignore build folders.
Otherwise it's only a question of time until you or your colleague checks in the build folder
You should use svn:ignore, and note that once you do for a folder, all child folders are automatically ignored. In your example, if the build folder were ignored then everything inside it would automatically be ignored. It looks like your build folder has already been added to repository though, so maybe you can ignore the dist folder inside bin.
Related
Guys:
I would know how to set up Eclipse so I can compare with my local project with head revision on remote server with EGit. Here is the situation: I imported a new project with Egit smoothly. However, I want to compare with head revision or a commit with my local project after I did some change. To my surprise, the eclipse listed every file in Build directory after I run ant to build the project. The file that I really updated was not even listed in compare with view. I attach a screen snapshot to show what is going on. Can anybody tell me how to set up compare with in eclipse?
Thanks a lot!
Sam
I faced the same issue.
Delete the .gitignore file (if present)in your directory. Refresh
Add files to Index.
The .gitignore specifies the pattern which will decide whether to ignore a path.
Note: Deleting the .gitignore is harmles and will show each and every change made in your repository including whitespaces.
Adding files to Index: will check for the new files and changes made, stages these files.
Thank You. I hope this will be helpful to you.
Decided to take the jump from CVS to SVN.
I setup a new repository in subclipse for my project. When I go to 'Finish' the setup it wants to do an initial commit and presents me with a flat list of files to select the files for version controlling.
The problem is I have thousands of generated binary files I dont want to commit.
So I click on cancel because it would take me all day to go through and unselect all the unwanted files. Annoyingly when I click on a parent category for the files I want to ignore it is not recursive!
So I click cancel then go to the eclipse directory structure for the project and manually set svn:ignore on all directories I want to ignore. Then I try and do a commit again and all the files are once again presented - ignore seems to have done nothing.
Can anybody point out what I might be doing wrong?
For the first commit, I recommend writing a small script to delete (of course you'll have a backup) all the files that are not meant to be committed.
Afterwards, if you find you accidentally committed a file, you can
svn delete file
Upon the first checkout, copy back (or better yet, regenerate) all the binary files. This will trigger svn to notice that your local repository is out-of-sync with the remote repository.
cd <Root of local repository>
svn status
You will see lots of "to be added" items. Go to the parent directory and add in svn:ignore properties for each of the generated items.
cd build
svn propedit svn:ignore .
which will open an editor (if it doesn't, you need to set the environmental variable SVN_EDITOR to a suitable editor). Then you can add in entries that svn will know are not tracked.
(in the ignore property editor)
target
build
image*
*.o
(and so on)
Save the file, and it will be staged for the next commit. Subsequent runs of svn status will no longer show these files as "needing to be added", but they will show the directory as "needing to be committed (it's a revision on the directory)"
Quick Aside
So I'm not entirely certain exactly which functionality of Subclipse you were using in order to create a repo and share a project to it, I'm assuming you created like a file based repo through the eclipse SVN repo view and tried to share and then commit to it. It looks like your problem got solved but I did want to add an answer on here because I ran across this post looking for the answer to this same problem of handling initial commits even just in general with SVN and wanted to offer help to anyone else looking for the help.
Intro
To start off I would recommend not working through an IDE extension like this just for the initial commit as they can miss a lot of the options for handling opening a repo in SVN. I personally really like the command line form of SVN to work with but TortoiseSVN is a good option for a GUI.
Whether you create a local file-based repo or are connecting to an SVN server and you want better control over your first commit in an previously unversioned project here is what I've found as the best general workflow for doing so.
Create the remote folder to save to.
On command line this will be:
$> svn mkdir your-url-scheme://your-site-address.domain/path/to/repo/example-directory
Or on TortoiseSVN open your repo for browsing, right click, and select "create new folder"
This will give you a location in the SVN repo to checkout from for our next step.
Checkout in to the already started project
Make sure to use the empty, newly created folder in your repo to checkout with. SVN does not actually require a folder being checked out to to be empty, which is an important part of what makes it actually very flexible and able to subsume parts of your directory into it fairly easily if used correctly.
Now you will checkout this empty folder into the root folder of your already started project. This will add your project to the working copy of this folder without any commit being made yet. The command is:
$> svn co your-url-scheme://your-site-address.domain/path/to/repo/example-directory /your/projects/root/
"co" standing for checkout. In Tortoise svn you can right click on or in the empty repo folder and select "checkout..." and then select the project root.
Set ignores and commit
Finally, you can easily set your ignores on certain files before adding any other files to the tree using the command:
$> svn propset svn:ignore file-or-directory-to-ignore
And to add all non-ignored directories and files:
$> svn add * --force
The force is technically unnecessary in this case but ensures full recursion. You can also now do all of this in your file explorer if using TortoiseSVN or you can even use your IDE extensions to do this at this point(make sure to ignore all files you need to before mass-adding files for commit), all that's left is to make sure to commit the newly added files to the repo and you're up and running with source control :)
Added this method here simply because this method allows you to avoid any unnecessary copying of those stinky binaries that no one wants to lug around with them.
Is there any way to have Subversion (in Eclipse) ignore a specific file. I've tried going to Team --> Synchronize with Repository, and the Mark as Merged option isn't available. I don't think it's possible, but does anyone have any ideas?
Not sure about eclipse and what ignoring file has to do with marking as merged, but what I'd do is svn pe svn:ignore <path> and add the file there.
After having refreshed your project with the repo, you just have to right click your file and "add to svn ignore" in the Team menu.
The option is available only if your file is not already in the repo.
If your file already exists in the repo, you will have to delete it first and recreate it as if it is a new one.
You can ignore only a single file or setup a mask.
It sounds to me as if the file is already added, which is a state it can't be ignored from. You need to remove it first, and you need to synchronise it fully first such that the server and client views of the file are equal.
You can do this by reverting the file, but keep a local copy so you can fix the file after it has been deleted from both sides (you'll delete the client copy, and will have to put it back again). After that, delete the file from the client side, commit, synchronise, put the file back, and then mark it as ignored from the SVN team menu (do not 'add' the file).
i'm using netbeans with the built-in mercurial support and want to omit a sub-folder from versioning.
how do i do that?
thanks!
I am not sure if there is a way to do this directly from Netbeans, but you can add a .hgignore file in the root of your repository to specify what files or folders to ignore. The following links will provide all the information you might need:
http://www.selenic.com/mercurial/hgignore.5.html
How can I ignore everything under a folder in Mercurial
http://kiln.stackexchange.com/questions/707/how-to-exclude-bin-and-obj-folders
This thread is old, but just in case people find it while looking for the answer...
Check this out: http://netbeans.org/kb/docs/ide/mercurial.html
Once you've initialized the project, if you've done in a valid location (generally right in the root of the project), all the "new" files will have green filenames & the new folders will display a small blue db icon on them. This indicates that they are not in sync with the repository and need to be committed/synced. You can select click any number of files & folders (singly or ctrl click) and choose Mercurial -> Toggle Ignore and the files will be ignored from then on. They will also turn gray to indicate that they aren't really being paid attention to.
You'll also want the Window->Versioning->Mercurial window open when working with Mercurial. This automatically refreshes a list of "locally" changed files that need to be synced with the repository. If an item is listed there & you mark it to be ignored, it (& any children in case of a folder), will be removed from the list to be synced.
When you're done with a revision, you can click the "Commit All" button in the Mercurial Window/Panel to sync the new file version(s) with the repository.
See the link above for more details on how to use the features.
Note also that NetBeans supports Git, SubVersion, & Mercurial, but to use any of them you have to first install them on your machine / have a system for NetBeans to connect to.
This is how it is as of v7.0.1+ (I didn't use it before then so I don't know if there are any differences before v7.0.1)
㋛ ㋡ ㋛ ㋡ ㋛ ㋡
Todd β)
I thought I'd get myself a Subversion setup at home for my hobby projects, and I'm trying to do it right, first time (my work's source control control policies or lack of them are, well, not perfect).
The thing I'm struggling with is this: I'd like to version entire Eclipse projects. This will be good from Eclipse's point of view - I'll just let it do its thing, and should just mean I need to ignore a few binaries / whole build directories and set up these ignores just once when I set up the project (right?). Anyway, I've tried it a couple of times and svn seems to get confused and ignore my ignore settings. What should be the correct procedure?
Thanks.
PS I'm doing the svn bits from command line, trying to avoid a GUI till I'm happy with it.
There are basically two ways to instruct subversion to ignore files either by name or by pattern.
The first way is to find the configuration file (location depends on platform) and add the file name or pattern to the global-ignores list. This applies to all svn operations on the machine or for that user.
The second way is to set the svn:ignore property on a versioned directory, for example:
svn propedit svn:ignore myDirectory
This brings up an editor for the svn:ignore property where you can add for example:
bin
obj
*.bak
Note that this property change is also versioned and needs to be committed, after that they apply for everyone working on that directory (after an update of course). This property doesn't apply recursively to subdirectories.
For more info see the svn book.
IIRC, Subversion won't stop you from svn adding files that you marked as ignored if you explicitly add them by name (though it may warn you). The svn:ignore property is primarily there to prevent them from showing up in svn status.
Also, AFAIK, the svn:ignore property is not recursive, so it will only work on first-level children of the directory it is set on.
If you on a linux box, you can try these steps, if on windows, pretty the installer shall do things for you.
https://help.ubuntu.com/community/Subversion
Also the subversion book might help
http://svnbook.red-bean.com/en/1.5/index.html
Could you be a bit more clear about what specifically svn is getting confused about? Remember that the svn:ignore property is a per-directory setting; i.e. if you want to ignore .foo files in ./bar and in ./bar/abc, you need to edit the property for each directory. Yes, it is a pain in the butt.
There are a couple of ways I've added projects to source control. Here's a higher level description:
One way is to import an empty top-level folder, then svn checkout, then copy the project files to that working copy, then svn add all but the files to be ignored (or svn revert specific files/folders) and set ignore properties as desired, then commit.
Another way is to make a copy of the project files, manually delete files and folders to be ignored, then svn import. Then delete those files. Then do an svn checkout, then setup the ignore properties on that working copy and svn commit. Then copy the original ignored files/folders to the working copy.
Of course, the more things that are globally ignored the easier these steps will be.