Svn+tortoisesvn+subclipse Usage Summary

Source: Internet
Author: User
Tags comments commit subversion client svn svn client svn update win32 tortoisesvn


First, SVN, TortoiseSVN, Subclipse introduction


Team Development Technology:

(1) Unit test;
(2) version control;
(3) Project automation;


SCM: Software configuration management, including SVN;

SVN is the successor to CVS and is a version control system;

Version control is simply to allow the team's people to quickly unify the code, enhance communication;

SVN consists of the client and the server, the server is the Project warehouse, where the project is stored, the client is a local copy, which is managed by SVN, can be submitted to the project warehouse and from the project warehouse to obtain the project place;

SVN tenet: Everything is a catalogue;

TORTOISESVN is the client of SVN, because if it is a traditional subversion client, it needs to complete the task through the command line, and the TORTOISESVN is done by the GUI;

Subclipse is a plugin in eclipse, which is simply an SVN client, just for the sake of eclipse development, so it can be submitted and imported in Eclipse; Download Address:

Svn:https://sourceforge.net/projects/win32svn/files/1.6.17/svn-win32-1.6.17.zip/download

tortoisesvn:https://downloads.sourceforge.net/project/tortoisesvn/1.7.6/application/ Tortoisesvn-1.7.6.22632-win32-svn-1.7.4.msi?r=&ts=1331344321&use_mirror=cdnetworks-kr-2

Subclipse Online installation Address: http://subclipse.tigris.org/update_1.6.x


Note: You need to configure the environment variables when you configure SVN;

(1) Path=c:/subversion/bin;

(2) Svn_editor=notepad; Set the default editor





ii. Description of the SVN command
Detection version: SVN--version and Svnadmin--version

Create a project warehouse: svnadmin Create D:\svn-repos

Importing files in the Tmpdir directory into Sesame/trunk is added instead of modified:
D:\SVNWORKSPACE\TMPDIR>SVN import-m "Import Sesame project". File:///d:/svn-repos/sesame/trunk

-M indicates that you can provide some comments;. means to import files from the current directory;

Note: Only the URL of the project warehouse is required at import, no URL is required in diff or commit;

Under Svnworkspace Checkout Specify the latest project and name SESAME:D:\SVNWORKSPACE>SVN Co file:///d:/svn-repos/sesame/trunk Sesame

Checkout items for the specified version (here is the first version): SVN checkout-r 1 svn://xiazdong-pc/sesame/trunk test3

View file status: SVN status Day.txt

See if the Project warehouse has an update: SVN status--show-updates
Note:
(1) M: locally modified, but not submitted;
(2) C (Conflict): There is a conflict in the update;
(3) G (Gather): The local version and the Project warehouse version are merged together;
(4) U (UPDATE): The local version was successfully updated;
(5) A (ADD): Add A New file to the working copy;
(6) D (delete): The file is deleted in the project repository, so the file is also deleted in the working copy;

View the local copy of the file changes (if the project warehouse changes, not check out): SVN diff Day.txt

See the difference between a project warehouse and a local working copy: SVN diff-rhead Number.txt

See the difference between version two: SVN diff-r2:4 Number.txt

See Recent changes: SVN diff-r prev:base Number.txt

Update local copy: SVN update

Update the specified directory or file: SVN update Number.txt dir1/dir2/

Note: When a conflict occurs, the prompt changes appear;
Select: (P) defer, (DF) Show all differences, (e) Edit,
(MC) My version, (TC) Other people's version,
(s) Show all options:

Commit changes: D:\SVNWORKSPACE\SESAME>SVN commit-m "Comments"
Note: Commit will only commit changes if a file is created in a local copy, then the SVN add file needs to be
If the conflict is not resolved at commit, the commit fails;

Get a log of a file: D:\SVNWORKSPACE\SESAME>SVN log Day.txt

Get a detailed log of a file: D:\svnworkspace\sesame>svn log--verbose Day.txt

Get logs between two versions: SVN log-r 2:4 Day.txt

Paging display log: SVN log | More

Note: SVN log is not necessarily the most recent log, because the version of the working copy may be inconsistent with the version of the project repository, and SVN log can only display the working copy version of the log

Note: * indicates an update;


Get Sesame Work copy information: SVN info sesame
copy files: SVN copy Number.txt copy.txt
Note: After the copy is only done locally, you need to submit the Update project warehouse;

Rename file: svn move copy.txt copy.py

Rename directory: SVN move dir1 Dir2

Renaming directories directly in the Project warehouse: d:\svnworkspace\test3>svn move-m "Rename" Svn://xiazdong-pc/sesame/trunk/number.txt svn:// Xiazdong-pc/sesame/trunk/dest.txt

Displays the latest version of each line of the file and who changed it: SVN blame Number.txt

Restore files:
Three ways to access the SVN merge-r 7:6 Number.txt Network:

(1) Svnserve
(2) SSH
(3) Apache

Start Svnserve:start svnserve--daemon--root D:\svn-repos for a specific project warehouse

Check out files via Svnserve: SVN co svn://xiazdong-pc/sesame/trunk vizier

The default Svnserve managed Project warehouse is read-only, can only be checked out, cannot be submitted, and is added in/conf/svnserve.conf:
Anon-access=read//anonymous user Read only
Auth-access=write//Authorized user writable
PASSOWRD=PASSWD//configuration in passwd file
Configuration in the passwd file: xiazdong=12345 indicates that the username is xiazdong and the password is 12345

Note: The svnserve.conf and passwd two file configuration must be shelf, otherwise invalid;


Attribute: The metadata of the file;

Set the Checked-by property for Number.txt to Xiazdong:svn propset checked-by "Xiazdong" Number.txt

Edit the Checked-by property in Number.txt (requires configuration Svn_editor set default editor): SVN propedit checked-by Number.txt

List all properties of Number.txt: SVN proplist Number.txt


Get a property: SVN propget checked-by Number.txt


Common Properties:
(1) Svn:ignore: ignoring some files; *.java means ignoring Java files
(2) Svn:eol-style: Set the newline character, generally native, indicating the change with the operating system;
(3) Svn:mime-type: Sets the MIME type of the file;
(4) Svn:needs-lock: Set file lock

Generally we can configure the Autoprops in the file, automatically set;
1. Look for the config file:
(1) Echo%appdata%
(2) \subversion\config
2. Set Enable-auto-props = True
3. Locate [Auto-props], and set the automatic properties
file Lock

Strict lock: Only one person is allowed to change a file;
Optimistic Lock: For example, have a, b two people at the same time checkout a file File.java, and at the same time to them modified, a first commit, when B want to submit, must first SVN update, the directory into the latest to be able to submit, the update will appear in two cases:
(1) If A and B change is not the same line, then the normal merger;
(2) If A and B change the same row, the conflict will be marked in the source code:

and subversion by default is optimistic plus lock;


For text files, conflicts can be resolved by merging, but for binary files, file lock resolution is required;

Open file Lock for file: Add Svn:needs-lock attribute to a file and commit to file repository;

File Lock: SVN lock day.txt-m "lock"

Force unlock (although someone else has a lock, but another person can force the unlock, but not get the lock): SVN unlock--force svn://xiazdong-pc/sesame/trunk/day.txt

Force locking (whether or not someone has a lock, grab it): SVN lock--force Day.txt


Turn to other directories: SVN switch SVN://XIAZDONG-PC/SESAME/BRANCHES/B1


conflict: <<<<<<<. Mine
Original code
=======
Project Warehouse Code
>>>>>>>. R4


Branches and Tags: simply, a copy of a working copy;

developed on the branch:

(1) Create the branches directory in the project warehouse; SVN mkdir svn://xiazdong-pc/sesame/branches

(2) Copy the trunk into the B1 directory in the project warehouse; SVN copy svn://xiazdong-pc/sesame/trunk svn://xiazdong-pc/sesame/branches/b1

(3) Checkout a copy of work through the B1 catalogue; SVN CO SVN://XIAZDONG-PC/SESAME/BRANCHES/B1 B1

(4) Submission;


Iii. Introduction to the use of TortoiseSVN


If you know the terminology in SVN, this tool is very easy to get started and used;


1.checkout


2. Conflict issues







Iv. Introduction to the use of Subclipse
1.checkout

2.commit, etc.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.