[Home]   [TOC]

Study_SCM  
SCM Study.
Updated Jan 17, 2014 by jht5...@gmail.com

SCM

SCM (Source Control Management)

Name Cmd URL Description
Subversion svn http://subversion.apache.org/ Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed under an open source license
Git git http://git-scm.com/ Git is a distributed revision control and source code management (SCM) system with an emphasis on speed
Mercurial hg http://mercurial.selenic.com/ Mercurial is a free, distributed source control management tool
CVS cvs http://www.nongnu.org/cvs/ CVS is a version control system, an important component of Source Configuration Management (SCM)

svn, hg, git 命令对照 [1]

第一次下载,包括源码和版本库
svn checkout http://path/to/repo repo_name
hg clone http://path/to/repo repo_name
git glone http://path/to/repo repo_name, git glone git://path/to/repo repo_name
下载服务器上最新的更新
svn update
hg pull && hg update -C
git pull
检出某个修订版本
svn checkout -r <rev>
hg update -C -r <rev>
git reset –hard -r <rev>
新增被跟踪文件
svn add /path/to/file
hg add /path/to/file
git add /path/to/file
移除被跟踪文件
svn rm /path/to/file
hg remove /path/to/file
git rm /path/to/file
生成补丁
svn diff >patch_file
hg diff >patch_file
git diff >patch_file
提交更改
svn commit
hg commit && hg push
git commit && git push
查看当前状态
svn info
hg status
git status
查看修订记录
svn log
hg log
git log
启动服务器
svnserve -d
hg serve -p 8002 &
git daemon –base-path=/path/to/repo –export-all &

SCM托管平台

Bitbucket https://bitbucket.org/
GitHub https://github.com/
Google Code https://code.google.com/hosting/
SourceForge http://sourceforge.net/
开源中国社区 https://git.oschina.net/
GitCafe https://gitcafe.com/

SCM托管软件

GitLab: Self Hosted Git Management Application http://gitlab.org/

参考资料

[1]. http://www.1uu2.com/archives/992