Mark files before committing to SVN - eclipse

Each time before committing I have a lot of changed files in my project. But also I have a lot of files that shouldn't be committed to SVN (it need me for local work). I need traverse all changed files and REMEMBER which of them should be committed.
Is that possible to mark(maybe with some Eclipse plugin) files for further selection and committing.

You can use changelists. See this Stackoverflow question on using changelists in Eclipse.
In Subversion 1.5 and higher, you can put your files into changelists. You can then commit, update, and revert only those files in that particular changelist. Put your "don't commit files" into one changelist, or the "I only want to check in these files into another changelist.
The svn:ignore won't work if these files are already checked into Subversion. It's only for adding new files.

Related

Applying hgignore file to already committed file Mercurial repo

Trying to do something similar to here: Applying .gitignore to committed files
Where you apply the new hgignore file to the already committed files.
I have node_modules folder already committed with thousands of files and I'd like to remove it by using the new hgignore file.
I can't find anything online for it to work on a Mercurial repo, any ideas? Thanks!
Edit .hgignore to match files you want to ignore
hg forget "set:hgignore()" and commit
See in action:
https://asciinema.org/a/kuJERsouDkOUBspADjDM5pMRQ
See also:
hg remove all files listed in .hgignore
How to check which files are being ignored because of .hgignore?
This is very easy once you get the steps. hgignore does not apply to the files already committed for tracking.
I use Tortoise Hg Workbench for UI.
In case build related binary files are checked in that need not be tracked, try this. When a rebuild is done, those files will again appear under files to commit. You can see this by selecting the green Commit button in the toolbar.
Select the files you want to ignore, then right click and select "Forget" (remember you have already committed the file earlier). This would mark the files as "R" for removal. Select the checkboxes next to the file and commit.
After commit, there would be a “?” mark next to those files and will appear in pink. Select those files and right click and select "Ignore". This would bring up the hgignore editor. Add to .hgignore from that editor.
Commit the .hgignore as well so that you have it safe.
In case you are using this for your personal work, why dont you try VSTS, its really cool, has both git and TFS as the backhaul! I moved all my personal work to VSTS.
Note: Sorry for not being able to upload screen shots, absolutely tight on schedule.. :(

Subclipse SVN first commit ignore certain directories

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.

Github and Eclipse: not all files are commited

I´m using Github in Eclipse, and commiting my changes to it. I have added some files to my project, and I have clicked on Team->"Add to index" in each of them, for them to be commited when I make a commit of the whole project. However, these files are not added to be commited, and when I click in "Commit", they arent´shown in the list of modified files. How can I force them to be commited?
Thanks.
It sounds like you may be confusing the usage of Git wit SVN. In SVN when you add a file to be tracked, updates to the file will always be committed automatically.
In Git, when you add a file to the index, only the current version of that file is recorded. If you subsequently update the file and commit, the new updates won't be included. The solution is to do an "Add to index" on the root of your project right before you commit: the equivalent of git add . on the commandline. Make sure your .gitignore is set up correctly so you don't commit things you don't intend to.
An equivalent action is to do a git commit -a, which automatically adds all files previously in the index and updates any deleted files as well. I believe the equivalent setting in Eclipse (for eGit) would be to Include selected untracked files as in the commit settings below.

Eclipse - SVN derived files are committed in background

I have several projects in eclipse and sometimes I mark a file as derived so SVN ignores the file and it doesn't get committed. For a while this worked for me but somehow I have some problems now. Some of these files get committed from my account. Svn history tells me that I did commit those files but I'm 100% sure I did not.
I have 3 files committed in the history but the dialog did only show 2 of them. Is there a problem when I put versioned files on derived ? So they somehow get committed in the background ? Because that's what it looks like to me. I never saw those files in my commit dialogue but Eclipse (4.2.1) Subversive (SVNKit 1.7.5v1) did commit them somehow.
Is there a better way to ignore those files in further commits ? They need to be in version control and I do have some local changes to these files who shouldn't be committed. So svn ignore is not an option.

Delete some files from the commit with Mercurial and Eclipse

I am using Mercurial with Eclipse. I made a commit and I commited some files which shuld not been commited.
Do you know if there is a possiblity to delete those files from the commit.
Thank you.
rollback (if it's the most recent commit) or strip (if it's older) would do it for you. This post has more details on these commands. To do it with MercurialEclipse, right click on your project in Eclipse and do Team-->Undo-->Rollback or Team-->Undo-->Strip.
If those aren't options, you could just remove the files in question and then commit that as a separate changeset. That would, of course, preserve the fact that those files were once under Mercurial control. If that is not desirable, this page lists some more options. If you go the MQ route, the workflow listed there can be done in MercurialEclipse via the "Mercurial Patch Queue" view.