I am using Tortoise SVN 1.6.16 in Windows 7. If I have a certain file type I want to exclude from future commits, I thought I could just go find a file of that type within my working folder, then right click it, and select "TortoiseSVN->Delete and Add to Ignore List->*.ext" where ext is the file extension of the file I clicked, as shown in the image below.
However, when I do this, it only excludes that specific file, and the next time I commit, all other files of that type still come up in the list to commit.
Am I doing something wrong? How can I just tell Tortoise or SVN to ignore all files of a certain type from future commits?
I had the same hunch as #Stefan: that you were probably seeing files in subdirectories and thinking those should have also been ignored even though you only applied the ignore to a single folder.
So if that is in fact the case, here is the recipe:
When you want to ignore files or patterns from a single directory:
Use the convenience menu command to add to the ignore list.
When you want to ignore files or patterns from a subtree:
Open the subversion properties (TortoiseSVN >> Properties) of the root of the subtree. Add or edit an entry for the svn:ignore keyword. The illustration shows an example where I have specified to ignore an obj subfolder as well as all files with a .user or .bak extension.
The secret, though, is in the specification--when you define the patterns to ignore, select the recursive choice as indicated here:
Unfortunately, there is one catch to this method: In my example, I had previously specified to ignore obj and *.user and I was adding just the *.bak pattern. When I apply recursively, it does not apply just the change (*.bak) but everything in the svn:ignore keyword (obj, *.user, and *.bak) to all subfolders. That may or may not be what you want, so be aware of it.
It ignores all bat files right, but not recursively! It only ignores them in the folder you added it to the ignore list.
You could also use Tortoise's global ignore pattern (if it's applicable to all your working copies):
TortoiseSVN -> Settings
General
Fill out the "Global ignore pattern" field, such as adding "*.ext" at the end of it, separating entries with a space.
Related
I'm using TortoiseSVN on Windows 10 for my SVN repository. I have now changed some files and folders.
How can I set them to ignore, so that the files/folders are not removed (or changed) from the repository, but just no commit of them takes place?
All appraoches I have seen so far remove the files from the repository.
In TortoiseSVN Settings on the General page (the first page that opens up), there's a Global ignore pattern option that allows you it ignore certain folders or extensions:
If you want to ignore a specific file (or folder), right click the file, click TortoiseSVN, and click Add to Ignore List. You'll get options to ignore the file, any file with the file's extension, and a few others. This property is committed to the repo for the folder.
Note: This option is only available if the file has not already been added to the repo.
If the file has already been added to the repo, there's no option to ignore changes. See Ignore files which are already versioned
You may also want to check out Subversion: ignore modifications to a file locally on one client only. If this solves your problem, you may want to delete this question as a duplicate.
I recently upgraded to Textmate 2 and now my dotfiles are not showing up in the file browser. Obviously, this is important when working with stuff like .htaccess files.
Is there a way to enable this feature?
Quick solution
Move the focus to the file browser (⌥⌘⇥) and show invisibles (⌥⌘i)(key names: option/alt+command/windows+i/eye). All invisible files will appear in the file browser. Press ⌥⌘i again to hide them.
Permanent solution
If you want to always show some dotfiles (for instance .htaccess), you can either add them in Preferences > Projects > Include files matching…
or add the list of files you want to show to the include array in one of:
~/Library/Application Support/TextMate/Global.tmProperties (same as using Preferences)
~/.tm_properties (global)
.tm_properties (inside a specific directory/project)
You can add all dotfiles (.*) but I don't recommend it since it can be a lot of clutter.
That said, you can also exclude files with the exclude array.
You can modify the behavior of the file browser via the config file ~/.tm_properties
To list all dotfiles and directories, you can set:
include = "{$include,.*}"
If you want to exclude some of those, for example the .git directory, modify the exclude variable:
exclude = "{$exclude,.git}"
There are many more options, check the Textmate site as an entry point for whats possible: http://blog.macromates.com/2011/git-style-configuration/
You can do this in the preferences of Textmate 2.
Navigate to: Textmate -> Preferences -> Projects. You should see two fields, one for including files, and one for excluding. I replaced the value of "Include files matching" with {*,.*} so it includes all normal and hidden files. I then just add the hidden files I want to exclude to the "Exclude files matching" field, such as .git and .DS_Store.
I would like to present in my GUI the SVN version of a certain file added to the project without hard-coding it each time I change something in the file and re-upload it to the SVN.
Is there a way to do that?
You need to use Subversion keywords, expressed as subversion properties on the file using the svn:keywords property. You'd set svn:keywords to Revision or Id to solve your problem. (Note that this solution updates data in the file, which is exposed when viewing or editing the file. It may or may not be shown an any particular GUI which is not a file editor.)
For more information on svn:keywords check out Special Keywords
For TortoiseSVN, right-button the file, pick TortoiseSVN, Properties, new, Keywords, and check the ones you want applied to the file.
Then, in the file, insert (in comments) the special strings $Revision$, $Id$, $Author$, etc. and Subversion will convert those into the actual data when the file is committed. Then, upon checkout, the data will appear and will be updated on the next commit.
If
your GUI can communicate with repository (i.e data is Working Copy or
you know filename-URL relation)
and
Production system has SVN-client
you can for any file-type get file-revision dynamically
svn ls -v URL (first column) or svn info URL ("Last Changed Rev" string)
I currently have a project which I want to add to SVN but I don't want to version certain file types. (e.g. .png) or a folder (images).
I know there's the svn:ignore, but this will not work if there's no .svn file in the directory which I'm trying to perform the ignore operation. I get the following errors :
property 'svn:ignore' set on '.'
svn: 'common' is not under version control
I'm looking for someone to inform me as to how to do this or direct me in the right place.
Any time I'm trying this, its like I have to add the file/directory to svn using 'svn add' and then run the ignore. I've a lot of directories and I'm looking to do this recursively also.
Is there a simple way to do this?
Set global-ignores in Subversion configuration file (normally found on Linux at ~/.subversion/config). See the manual for more info.
I am working on a shared project which is put in SVN. The directory structure of the project is as follows:
ParentDir
- Child_Dir_1
+ GrandChild_Dir_1
+ GrandChild_Dir_2
- Child_Dir_2
Child_Dir_1 contains configuration files (Eclipse's .LAUNCH files), and people put all sorts of file in this folder.
So each time I update my source code (by right clicking on ParentDir and picking Update), I got a lot of configurations that I don't really need, and I have to delete them manually.
I still need to have the children of Child_Dir_1 (which are GrandChild_Dir_1 and GrandChild_Dir_2) to be updated.
I have tried to go to set the "ignore" property of the of Child_Dir_1 to exclude *.LAUNCH files, but each time I update the source code, the ones that I manually deleted are restored to Child_Dir_1.
Since you are using TortoiseSVN:
Go into Child_Dir_1, select GrandChild_Dir_1 and GrandChild_Dir_2 and right click, TortoiseSVN -> Update.
That will update only those two folders.
Ignore is so that you can "ignore" ( from commit, status etc.) untracked files, files that are not checked in.
It could be that manojlds' answer is the solution for you, but I have doubts. The problem here is that those files are really part of the project. They are kind of unavoidable, and must be in sync with the rest of working copy.
Option 1 (best): Remove all configuration files form repository, or better yet have in repository only configuration template files (with, say, $ as first character in file names). Each user could copy those template files to true configuration files and change them accordingly. Configuration files should not ever be committed. Only template files should, but updating template files will not mess with current configuration files of any user.
Option 2 (second best): Ignore those configuration files. Use your own files for your own configuration, with names that don't clash with existing. You may even add your files to SVN, but you may just as well not add them. Does not matter, as long as you don't need your configuration on another machine.
Option 3: Use ignore-on-commit group. Use those configuration files that already exist. Change them to your likings, but don't ever commit them. To ensure that you don't commit them by accident flag them as non-committable (go to commit window, select all non-committable files, right click > Move to changelist > ignore-on-commit). The problem with this is your files are not protected from other users' updates, but may actually be a good thing.
Option 4: Chop the folder out (a horrible hack). Remove Child_Dir_1 from working copy (Right click on it > Update to revision > set Working depth to Exclude). Save the folder elsewhere first, because it will disappear. After that create it again, inside it checkout all subfolders (GrandChild_Dir_1 and GrandChild_Dir_2), and copy your configuration files. Now you have complete control over folder's contents, but update and commit become more complicated.
Edit: There is option 5 in theory, but I doubt it can be implemented successfully. You can try: Use NTFS hard links. Copy the whole tree with all files as hard links to existing files, except .svn folders and their contents. Original directory is used for SVN operations update, commit, add and delete, and new directory is used for editing files. From new directory delete all the files you don't need, and insert all the files you do need that are not the part of SVN. The problem here is minor extra work when deleting files from and adding them to SVN.