I have used TortoiseSVN_integration.bat to integrate SVN with Bugtracker and ultimately Visual Studio.
svn propset -R bugtraq:label "BugTracker.NET ID:" .
svn propset -R bugtraq:url "http://DOMAINNAME/edit_bug.aspx?id=%%BUGID%%" .
svn propset -R bugtraq:message "bugid: %%BUGID%%" .
svn propset -R bugtraq:number "true" .
svn propset -R bugtraq:warnifnoissue "true" .
svn commit -q -m "Added BugTracker.NET properties to the repository"
Also see the following pic:
http://oi62.tinypic.com/2u6ihww.jpg
I'd like to remove this integration as it's no longer needed.
How do I do that?
Thanks
Use propdel to remove all bugtraq related properties, starting at the root of your working copy, or wherever you ran the batch file from.
Make sure you run include the -R option since your propset command was also recursive, then commit and you should be done.
Another option is to use Windows Explorer -> TortoiseSVN -> Properties on the root directory folder, then multi-select the bugtrack properties, click Remove, then Recursive, then commit.
Related
Hi i want to revert all changes to the files with a specific filename in a local repository.
In this case AssemblyInfo.vb, i'm using the TortoiseSVN cli.
I have the following directory structure
Root
Project 1
File1.txt
My Project
AssemblyInfo.vb
Project 2
File2.txt
My Project
AssemblyInfo.vb
Now while standing in Root i run the command svn.exe revert --recursive AssemblyInfo.vb and the output i get is:
Skipped 'AssemblyInfo.vb'
I have tried to add double and single * before the filename with no success, does --recursive/-R work or what am i missing?
svn help revert gives the following output:
revert: Restore pristine working copy state (undo local changes).
usage: revert PATH...
Revert changes in the working copy at or within PATH, and remove
conflict markers as well, if any.
This subcommand does not revert already committed changes.
For information about undoing already committed changes, search
the output of 'svn help merge' for 'undo'.
Valid options:
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--changelist [--cl] ARG : operate only on members of changelist ARG
Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG (caution: on many operating
systems, other users will be able to see this)
--no-auth-cache : do not cache authentication tokens
--non-interactive : do no interactive prompting (default is to prompt
only if standard input is a terminal device)
--force-interactive : do interactive prompting even if standard input
is not a terminal device
--trust-server-cert : deprecated; same as
--trust-server-cert-failures=unknown-ca
--trust-server-cert-failures ARG : with --non-interactive, accept SSL server
certificates with failures; ARG is comma-separated
list of 'unknown-ca' (Unknown Authority),
'cn-mismatch' (Hostname mismatch), 'expired'
(Expired certificate), 'not-yet-valid' (Not yet
valid certificate) and 'other' (all other not
separately classified certificate errors).
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf
If i run svn.exe revert --recursive AssemblyInfo.vb in a directory that directly contains a modified AssemblyInfo.vb it works as intended.
svn revert is designed to help fix mistakes, not cause problems by "helping" users to accidentally or unintentionally remove their local and uncommitted changes.
If you want to revert all the changes in your SVN working copy or in a directory and all its childs, you could run svn revert . -R. But you must not run this command if your working copy has a mixture of valid uncommitted changes that you don't want to lose and the changes that you want to revert to unmodified state.
Reverting local changes is an irreversible operation. Therefore, reverting local changes in SVN working copy via svn revert must be done cautiously. Assume that you are working on a task and haven't yet committed some important changes you've been working on a couple of hours. But at the same time you have some changes in a file or directory that you want to revert. Carelessly running svn revert . -R at the root of working copy will revert all the uncommitted changes in the working copy.
Citing SVNBook | svn revert
svn revert is inherently dangerous, since its entire purpose is to
throw away data—namely, your uncommitted changes. Once you've
reverted, Subversion provides no way to get back those uncommitted
changes.
If you provide no targets to svn revert, it will do nothing. To
protect you from accidentally losing changes in your working copy, svn revert requires you to explicitly provide at least one target.
Now while standing in Root i run the command svn.exe revert
--recursive AssemblyInfo.vb and the output i get is:
svn revert does not work this way. By default, it runs with --depth=empty to ensure that it won't revert more than the user intended. But runningsvn revert with -R is the same as running it with --depth=infinity. Generally speaking, in this particular case --recursive is an alias for --depth=infinity and its purpose is to help users revert all the local modifications (e.g. after invalid merge).
When you run svn revert with --recursive, the tool expects you to specify a path to a directory in your working copy and the operation will revert ALL the changes that are in this directory and its childs. There will be no effect if the command's target is a file.
What you look for is --targets and a bit of scripting. For example, run the following commands in PowerShell console (I'm sure that it could be done more elegantly in PowerShell than in this example):
(dir -Path "files.html" -Recurse -File).FullName | Out-File -Encoding ASCII mytargets.txt
svn revert --targets mytargets.txt
dir is an alias of Get-ChildItem cmdlet in PowerShell. In this case it grabs the list of all files with name files.html and writes the full paths to mytargets.txt file. Then it runs svn revert that reads paths from mytargets.txt and revert local modifications made to the files.
I advise this approach instead of piping the output to svn revert because you can (and should) review the list of items that svn revert will process. This helps you ensure that you won't revert more that you actually intended.
On Linux this can be done using combination of find and xargs commands from findutils:
find -name AssemblyInfo.vb | xargs svn revert
On Windows you can probably install and use Cygwin which contain these utilities.
I'm using slik svn client and I wanna know if there is any way to only commit files that match a given extensions. I'm aware of the ignore prop (and hooks). But I'm wondering if there is an easy way, such as: svn commit *.cs for committing only C# files. (I've tried that and it doesn't work ;))
For me, it is easy to say commit these three file extensions and just ignore the rest.
Any help will be appreciated, Thanks!
If they are in the same directory, yes, for example:
svn commit *.cs
svn commit path/to/subdir/*.cs
If they are not in the same directory, and you can only use DOS, then no.
If you have cygwin or Git Bash, then you could do this:
find . -type f -name '*.cs' -exec svn commit {} +
The svn commit command doesn't have a filtering option for selecting a subset of files, you can only use shell globs (like *.cs).
I am working on a number of projects simultaneously. Each project has a Subversion repository. The repositories are not all hosted on the same server. When I start my day, I find myself having to do an svn update for each of the individual projects.
My local working copies are all stored under one parent directory Projects.
My question: Is there a command that can be issued from the Projects directory that will search for working copies among the descendants in the file system and issue an svn update command for each of them?
I'm on Ubuntu with Subversion version 1.7.5.
cd to Projects and then:
svn up `ls -d ./*`
(note those are backticks, not single quotes.)
svn will happily skip non-svn dirs.
You could add an alias in your .bashrc
alias up-svn='svn up `ls -d ./*`'
You could just write
svn update *
That's it... Subversion will automatically recognize the working copies and do the update
One more suggestion similar to #thekbb answer
svn up `find ~/svn -maxdepth 3 -type d`
Explanation:
'~/svn' is my directory all checked out repositories are in
'-maxdepth 3' some repositories are nested (3 levels deep)
e.g. companyname/projectname/branch
'-type d' only directories
no, but you can easily write a script/batch file that calls "svn update" on each subdirectory.
I need to change the case of folders and files. First thing I tried was renaming the folders, but Git didn't pick up the changes. So I tried using git mv -f controller Controller but it says :
fatal: renaming 'application/classes/controller failed: Permission denied
I have tried setting the global ignorecase flag:
git config --global core.ignorecase false
But it still doesn't work. Some people have suggested to move the folder out of repo, delete, then re-add but would this change get picked up when other people pull the repo? Is there anything else I could try?
Edit: It works for files but not folders.
In summary of the comments, you'll have to rename the directory via a intermediate temporary name. E.g.
git mv controller Controller-tmp
git mv Controller-tmp Controller
I think this has to do with the fact that the MinGW implementation of rename(2) does not support this operation. See this thread, the MSDN docs on the CRT rename implementation and those of the MoveFileEx function.
Make sure to close Visual Studio and any Windows Explorer folders related to that path.
Make sure to add the changes to index after rename folder with intermediate folder as below.
git mv oldfolder newfolder
git add -u newfolder
git commit -m "changed the foldername whaddup"
Reference
I could not resolve this apart from performing the following
Branch from commit before folder name case changed, as a temp branch just to resolve this issue.
Cherry picking commits in order resolving folder case name changes before committing.
Reset old branch this new temp branch final commit.
Remove temp branch.
I'm using Git for Xcode 4 project version control. I've explicitly added ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate to .gitignore, but Git it won't ignore it. Any ideas why this is so?
Git is probably already tracking the file.
From the gitignore docs:
To stop tracking a file that is currently tracked, use git rm --cached.
Use this, replacing [project] and [username] with your info:
git rm --cached [project].xcodeproj/project.xcworkspace/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"
Alternatively you can use the -a option to git commit that will add all files that have been modified or deleted.
Once you've removed the file from git, it will respect your .gitignore.
In case that the ignored file kept showing up in the untracked list, you may use git clean -f -d
to clear things up.
1.
git rm --cached {YourProjectFolderName}.xcodeproj/project.xcworkspace/xcuserdata/{yourUserName}.xcuserdatad/UserInterfaceState.xcuserstate
2.
git commit -m "Removed file that shouldn't be tracked"
3.
WARNING first try git clean -f -d --dry-run, otherwise you may lose uncommited changes.
Then:
git clean -f -d
All Answer is great but here is the one will remove for every user if you work in different Mac (Home and office)
git rm --cache */UserInterfaceState.xcuserstate
git commit -m "Never see you again, UserInterfaceState"
Had a friend show me this amazing site https://www.gitignore.io/. Enter the IDE of your choice or other options and it will automatically generate a gitignore file consisting of useful ignores, one of which is the xcuserstate. You can preview the gitignore file before downloading.
In case the file keeps showing up even after doing everything mentioned here, make sure that this checkbox in Xcode settings is unchecked:
Just
"git clean -f -d"
worked for me!
Here are some demo & short cuts if you uses GitHub, the basic ideas are the same.
1. Open terminal like this
2. Paste the below command to terminal followed by a space and then paste the path of the .xcuserstate file simply like this
git rm --cached
3. Make sure you have the correct git ignore and then commit the code :)
This works for me
Open the folder which contains the project file project.xcworkspace from the terminal.
Write this command: git rm --cached *xcuserstate
This will remove the file.
For me nothing worked, but this
add this line to your gitignore
*.xcuserdata
Here is one more simple solution if you are using the source tree app.
here are the instructions
1.Right-click on the file which you want to add to the git ignore list and select stop tracking.
again right-click on the same file and you will notice ignore option is now enabled then click on ignore button.
now you can reset or commit your changes for the same file it depends on whether your changes are important or not. changes in the future will not be tracked for the selected file.
Here is a very nice explanation of how to remove the files in question recursively from your git history: http://help.github.com/remove-sensitive-data/
Very useful, because otherwise tools tend to 'hang' while trying to show the diff on those huge files that shouldn't have been checked in the first place...
Here's what you can do (in short) to get rid of the largest stuff:
cd YourProject
git filter-branch --index-filter 'git rm --cached --ignore-unmatch -r YourProject.xcodeproj/project.xcworkspace' HEAD
# see what you want to do with your remote here...
# you can: git push origin master --force
# or you can delete it and push a fresh new one from your cleaned-up local...
rm -rf .git/refs/original
git gc --prune=now
git gc --aggressive --prune=now
Worked very nicely for me :)
For xcode 8.3.3 I just checked tried the above code and observe that, now in this casewe have to change the commands to like this
first you can create a .gitignore file by using
touch .gitignore
after that you can delete all the userInterface file by using this command and by using this command it will respect your .gitignore file.
git rm --cached [project].xcworkspace/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"
You can also ignore files from Xcode preferences itself.
Generate gitignore file from https://www.toptal.com/developers/gitignore
Go to Xcode -> Preferences -> Source Control -> Git -> Add all ignore items in the list...Even though UI is not really useful & you have to add all items individually but adding ignore files here surely works.
I think it would be better to write like this.
git rm --cache *//UserInterfaceState.xcuserstate**