- install Tortoise SVN 1.6.7
- go in
g: - create the directory
laurent_svn_repository - go in it
- create the directory
my_project - right click and select
- somewhere else on the filesystem, create a directory
tempo - go in it
- create the 3 directories
branches,tagsandtrunk - go in the
trunkdirectory - copy the source hierarchy in it
- go back to where the
tempodirectory is created - right click and select
- select the URL:
file:///G:/laurent_svn_repository/my_project - type the import commit comment
- click on
Eclipse
- Installation
- add
https://dl.bintray.com/subclipse/releases/subclipse/latest/to the update sites - retrieve the packages from it
- add
- Solution 1
- open "SVN Repositories" View
- right-click and select
- set the location URL to
file:///G:/laurent_svn_repository/my_project - expand the created repository
- right-click on the
trunkdirectory and select - in the "Check out from SVN" dialog
- select
- click on
- in the "New Project" Dialog
- select
- click on
- type the project name in
- select
- click on
- Solution 2
- in the "New Project" Dialog
- select
- click on
- select
- set the location URL to
file:///G:/laurent_svn_repository/my_project - click on
- select the directory
- click on
- select
- click on
- in the "New Project" Dialog
- select
- click on
- type the project name in
- select
- click on
Command line
- Display help
svn help - Display help of command
foobarsvn help foobarsvn foobar -h - Create a repository
svnadmin create <dir> - Perform a checkout (<myDir> will be created)
svn co file:///cygdrive/m/laurent_svn_repository/Java\ sandbox/trunk <myDir> - Display repository, branch… of the current directory (i.e. working copy)
svn info - Display status of working copy files and directories
svn status - Commit
- Commit a file/dir
svn commit -m "I have done blabla…" <file/dir> - Commit the current directory
svn commit -m "I have done blabla…"
- Commit a file/dir
- Revert all files
svn revert -R . - Display the diffs
- Display the diff of the current directory
svn diff - Display the diff of a file/directory
svn diff <file/dir> - Perform a side-by-side comparison (on Linux/cygwin)
svn --diff-cmd "diff" --extensions "-y -W 250 --suppress-common-lines" diff - display the diff of a given commit
svn diff -c 42 <file/dir>
- Display the diff of the current directory
- Display the log
- Display the log of the current directory
svn log - Display the log of a working copy of a file/directory
svn log <file/dir> - Display the log of a repository
svn log file:///cygdrive/m/svn_repository/my_project/trunk - Display the information about commit 42
svn log -c 42
- Display the log of the current directory
- Blame
- Annotate each line with author and revision
svn [blame|praise|annotate|ann] <file> - Annotate each line with author and revision, ignoring white space changes
svn blame [--extensions|-x] -b <file>
- Annotate each line with author and revision
- Update the current directory to head
svn update - Display a revision of a file
svn cat -r 123 <file>
svn cat --revision=123 <file> - Copy a tag
svn copy "https://svn.eurofins.local/EOL/tags/EOL-2014-12a-RC2" "https://svn.eurofins.local/EOL/tags/EOL-2014-12a" -m "issue #97713: Create SVN tag for EOL-2014-12a" - Clean up the working copy (i.e. remove locks and resume unfinished operation)
svn cleanup - Verify the integrity of the repository
svnadmin verify /cygdrive/m/laurent_svn_repository/homepage - Relocate
- Define the new location of the repository
svn relocate file:///cygdrive/m/svn_repository/my_project/trunk working_copy - Define the new location of the repository (assuming the current directory is the working copy)
svn relocate file:///cygdrive/m/svn_repository/my_project/trunk
- Define the new location of the repository
- Adding/removing files
- Add a file/directory in the local repository
svn add <file/dir> - Add all new files (except the ignored ones) in the local repository
svn add --force . - Delete a file from the local repository
svn delete <file>
svn del <file>
svn remove <file>
svn rm <file>
- Add a file/directory in the local repository
- Renaming a file
svn [move|mv] <old name> <new name> - Branches
- List the branches
svn ls file:///cygdrive/m/svn_repository/my_project/branches - Create a branch <branch name> from trunk
svn copy file:///cygdrive/m/svn_repository/my_project/trunk file:///cygdrive/m/svn_repository/my_project/branches/<branch name> -m "Branch creation comment" - Check out branch <branch name>
svn co file:///cygdrive/m/svn_repository/my_project/branches/<branch name> <directory name> - Merge trunk into current work directory (which contains the checkout of a branch)
svn merge ^/trunk - merge a branch on trunk
in a checkout of trunk with no local edit
svn update
check the merge resultsvn merge --reintegrate ^/branches/my-branch
the branch is no longer usable for further work, it is not able to correctly absorb new trunk changes, nor can it be properly reintegrated to trunk again, so it is better to delete the branchsvn commit -m "Merge my-branch into trunk"
svn delete ^/branches/my-branch -m "Remove my-branch, reintegrated with trunk in r123."
- List the branches
- Properties
- Set the value of a property on a file/directory
for examplesvn propset <property name> <property value> <file/directory name>svn propset svn:ignore "*" tmpdir - Get the value of a property of a file/directory
for examplesvn propget <property name> <file/directory name>svn propget svn:ignore tmpdir - Remove a property of a file/directory
for examplesvn propdel <property name> <file/directory name>svn propdel svn:ignore tmpdir
- Set the value of a property on a file/directory
svn:ignoreis the property defining the elements ignored in a directorysvn:global-ignoresis the property defining the elements ignored in a directory and its sub-directories