about SVN .
SVN is a centralized source-code management tool
Concept:
1> Repository Code warehouse, store code repository
2> Server server, save all versions of the Code warehouse
3> client clients, save only the current user's Code warehouse
4> User name & password access code warehouse needs to use its own "User name and password", so that different people can distinguish the code changes
Operation:
1> Checkout Download the latest code warehouse on the server to local, "only need to do once"
2> Update Downloads Other people's changes from the server to local, "What you have to do every day"
3> commit commits the work to the server, "do it at least once a day before work"
The SVN server installs Visual SVN server
Tip: The general programmer does not have the opportunity to install the SVN server, the following information is only for the installation and configuration process on the server
* Visual SVN Server is running on Windows operating system, integrated with subversion and Apache
* Fool-type installation one step, and provide a graphical interface, easy to install simple configuration
*: http://www.visualsvn.com/server/download/
1> Installation
* Program Directory
* Code Warehouse Directory
2> Add code Warehouse "Weibo"
* The default structure (trunk, branches, tags) is not checked at the time of the test, but it is checked when doing the project
3> adding users
# User name password
# Manager Manager
# Zhangsan Zhangsan
# Lisi Lisi
4> add groups, through the group can set multiple users to the code warehouse access, easy to manage
03.Unix Common Commands
1> Show hidden folders
# Show hidden files
$ Defaults write Com.apple.finder appleshowallfiles Yes && killall Finder
# do not show hidden files
$ Defaults write Com.apple.finder appleshowallfiles No && killall Finder
2> SVN basic commands
command-line format:
SVN <subcommand> [Options] [args]
Description
SVN subcommand [options] [parameters]
Tips:
# The content contained in [brackets] is optional
# (Sub-command abbreviation)
3> Viewing Help information
$ SVN Help
View Help for all SVN commands
$ SVN Help subcommand
4> Common UNIX Commands (Unix common commands. m)
1. CD Change Working directory
2. PWD output the absolute path of the current working directory
What commands to execute in UNIX, be sure to know your current working directory
3. $ ls View file
$ ls Display file
$ ls-a Show All Files
$ ls-l List Display file
$ ls-la list shows all files
4. Touch is used to change the file access and modification time of standard UNIX programs, also used to create new files
$ Touch Test.txt
Note: Touch does not modify the Test.txt content, only changes its access, modification time, if Test.txt does not exist, it will be created
5. Cat continuously View file contents
6. More paging to view the contents of the file
The SVN operation process under command
Download the server file to a local
# Switch Working directory
$ CD Manager's working directory
# Checkout the code warehouse on the server
$ svn Co Http://192.168.1.103/svn/weibo--username=manager--password=manager
Tip: After Checkout (CO), the command line records the user name and password, and subsequent operations are not specified separately
Manager Add File
* SVN common commands
--------------------------------------------------------------------------------
# view local code base status
$ SVN St
Error: "Is not a working copy", must be in SVN's working directory in order to correctly use the SVN command
# View SVN logs
$ svn Log
# View a log of a file
$ svn log filename
# View a log of one version of a file
$ svn log [email protected]
* Create a file
--------------------------------------------------------------------------------
# Switch to working directory
$ cd Weibo
# Create a file
$ Touch MAIN.C
# Open and Write file contents
$ open MAIN.C
* Submit the file to the server
--------------------------------------------------------------------------------
# View working directory Status
$ SVN St
# Add files to the local repository
$ svn Add main.c
# submit the file to the server's repository
$ svn ci-m "added Main.c file"
team members Join
1> Zhang San
$ svn Co Http://10.0.1.15/svn/weibo--username=zhangsan--password=zhangsan
2> John Doe
$ svn Co Http://10.0.1.15/svn/weibo--username=lisi--password=lisi
1> project preparation, usually done by project manager
2> programmers only need to bring the project co locally
Tip: Don't forget to ask your manager to assign SVN's account and password when you enter a new company
Zhang San. Add Files
# Add File Person.h person.m
$ Touch Person.h person.m
# Modify Person.h person.m
$ open Person.h
$ open PERSON.M
# Add Person.h person.m to the local code base
$ svn Add person.*
# Submit content to the server
$ svn ci-m "added Person class"
05. deleting files
# Delete Files
$ SVN rm Person.h
# Commit Delete
$ svn ci-m "deleted Files"
Note: Do not use File Manager to delete files directly
06. Undo Changes
$ svn revert person.m
07. Revert to a previous version
$ svn update-r 5
$ svn up
08. Conflict resolution
(p) Postpone contrast
(MC) Mine-conflict Use my
(TC) Theirs-conflict use each other's
. SVN file status
"No Modification
' A ' is added to the local code repository
' C ' conflict
' D ' was deleted
' I ' is ignored
' M ' was modified
' R ' is replaced
' X ' external definition of the created version directory
'? ' file is not added to the local repository
'! ' file is missing or incomplete (not files deleted by SVN command)
' ~ ' controlled file blocked by other files
The operation flow on the SVN graphical tool Cornerstone
Installation Cornerstone
02. Specific operation
1> adding a remote code warehouse
2> exporting code libraries to local
3> using Xcode to create a new project in a local directory
Note: Do not tick git, two sets of source code control exist conflict
4> Submit to code Warehouse
5> Other user actions
03. Ignore some files that you do not need to upload
04. Catalog Specification
1> Trunk
The version currently being developed by the project
Typically entered the company and developed under this directory
2> Tags
Store major versions that are already online
3> Branches
When a major bug or new requirement occurs
iOS Source code Control SVN