exclude some files from synchronization with SVN , eclipse IDE - eclipse

Is it possible to exclude/ignore some specific files from synchronization with SVN that are present in svn ??
These files are already present in SVN, and I believe from other posts that the rightClick->Team->SVN:IGnore only works for files that are not there in svn.
I have read other posts but can not find the answer.
Reason : we have some files that have some specific content in SVN while some other content in local workspace, People by mistake are checking in theirversion of these config files to SVN.

Perhaps there is an easier way to do it, but following should work:
Optional: save your file somewhere, in case you can't recreate it
Open 'SVN Repositories' view, navigate to location of file you don't want to be in SVN, right click on it and choose 'Delete'. This would remove file from repository
Synchronize. You would see file removal as incoming change. Accept it. This would remove file from your local file system
Recreate file in your local file system, or copy from step (1). File would show as outgoing change if you synchronize at this point.
Now you should be able to do 'Right click->Team->Add to SVN Ignore' on it. Do this and commit property change on the folder.

TortoiseSVN has a option in the Windows-context-menu by right-clicking on the file to unversioncontrol and add to ignore list. The action should also be recogniced by the plugin, even if the plugin menu has not this option.
If you do not want to use Tortoise for this, a simple workaround would be:
remove the files from the folder(store them temporaly else where)
commit, the removed files.
if you are not on the commiting computer update now
paste back in the removed files and add them to the ignore list.

Related

How to ignore files via GUI in Gitkraken?

I come from SourceTree to board the GitKraken hype train. It has always been pretty easy to ignore files within ST. Just right-click on a file in the unstaged container and you've all the options. You can ignore the files directly, each file beneath a specific folder etc. (so, all the .gitignore stuff from within the GUI =)).
However, I can't find a similar feature in GitKraken. Does anybody know how I can ignore files via the GUI of GitKraken?
Please note: This is not a git question. I absolutely know in depth how ignoring files in Git work. But that's not the topic whatsoever. This is just a trivial GitKraken support question.
Currently there isn't an option to ignore a file through the GitKraken GUI.
If you check their post on twitter this is planned to be implemented soon and it will be in their release notes once this is completed.
UPDATE (26.01.2017.):
Version 2.0.0 brings the .gitignore option to the list of functionalities. You can now select a file or folder in the file staging area, and add to the .gitignore file on the fly. Right-click and select Ignore. From there, you can:
Add that specific file to .gitignore
Add all files with that file extension to .gitignore
Add all files in the same folder as the selected file to
.gitignore
(If selecting a folder) add that folder to the .gitignore

How to get deleted file from SVN Repository

I deleted a file from my Eclipse work space but that file is in SVN repository. Could any one help me to get my deleted file from SVN without using the command line?
There's a simpliest way to recover the file with Eclipse+SVN only.
Go to SVN Repositories view, find a folder your file was located, make a right click and choose Show History. You will see the list of commits to THIS FOLDER in the History view. Please make sure it's switched to Remote Revisions. From the list of commits find a commit that deleted the file. In the pane below there's a list of files involved with this commit - you can find deleted files with minus sign. Double click will open this file in editor...
If you've deleted the file in Eclipse, Eclipse has told Subversion to mark the file for deletion. This means the next commit will delete the file. You'll have to do a revert.
If you've deleted this file via Internet Explorer or some other file browser, and didn't tell Subversion, then the file isn't marked for deletion. Simply updating the file will bring it back.
This is where the command line client sings. With the command line client, I could tell Subversion to update or revert a nonexistent file. With a GUI, I would first have to select the file, then tell Subversion what to do. But without a file, I can't do anything.
Easiest solution: Recreate the file. The contents are not important. It can be empty or contain a dirty limerick for all you care. You're basically making a file you can select with your file browser.
Then, you can select the file and tell Subversion and/or Eclipse via the Team menu to revert it. This way, it doesn't matter how the file was deleted. Subversion will restore the file back to its original checked out version.
Along the lines of Bryn's solution, using Subclipse, find the delete 'D' entry for the file in SVN history, right-click and do "Copy..." which will then ask you to specifiy a location in your Eclipse workspace. Click OK, it will probably take a little while, and that's it.
I first tried "Export...", but that didn't work for me, seems like subclipse is looking in HEAD, even though an older revision was selected.

.so files are not committing to SVN

Possible duplicate
I fail to commit a .so library file using subclipse
I am developing an android application and in that I am trying to add some .so files from UlraliteJ framework. When I googled, I could see that .so files are ignored by SVN by default. So, I uncomment the line global-ignores in the config file of /.subversion folder as per this example
http://blog.keksrolle.de/2010/03/01/svn-ignores-file-extension-so-by-default-which-corrupted-my-build.html.
But, even then I was not able to commit them.
After that, I found the above post, so following that, I manually added .so files to version control and they have been added now.
But, now my problem is that they are not getting committed to SVN still. It fails with the following message,
svn: Commit failed (details follow):
svn: File not found: transaction '1635-1c5', path '/SVNfolder/trunk/OS_Android/SVNProject/libs/armeabi/libmlcrsa12.so'
If any body knows the answer, can you please share it with me
Here is my solution to this annoying problem using Eclipse and SVN
select the "SVN Repository Exploring" perspective.
choose the right folder where the .so files should be in the "SVN Repositories" view.
right click and choose the "import" menu
in the pop out dialog, choose a local path which containing the .so files, input the commit comment and hit OK button.
now the .so file are at the correct position.
Finally, I am able to commit after a day of effort. Thanks to this guy,
SVN: Folder already under version control but not comitting?
All you need to do is, take a back up of your project. Go to the problematic folder. In my case it was armeabi folder inside /lib of my project. View hidden files. There will be a .svn folder. Delete that.
Then revert back the .so files, clean the project. Add them back to the version control. Now along with the files, one more file named svn-commit.tmp.save is also created. Don't worry. Just commit the whole folder. Thus it is committed now.
How ever, I din't exactly know the need for deleting .svn folder.

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.

Have Subversion (in Eclipse) Ignore Specific File

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).