Chinaunix首页 | 论坛 | 博客
  • 博客访问: 586412
  • 博文数量: 201
  • 博客积分: 3076
  • 博客等级: 中校
  • 技术积分: 2333
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-02 19:44
文章分类

全部博文(201)

文章存档

2010年(118)

2009年(83)

我的朋友

分类:

2010-07-07 23:59:21

SVN,HG,GIT是三种常见的版本控制系统,本文简单列出一些相似的操作命令。当然,三种系统各有特点,严格的对应关系是没有的。

1,第一次下载,包括源码和版本库:
svn checkout repo_name
hg clone   repo_name
git glone repo_name或者git glone git://path/to/repo repo_name

2,下载服务器上最新的更新:
svn update
hg pull && hg update -C
git pull

3,检出某个修订版本
svn checkout -r
hg update -C -r
git reset –hard -r

4,新增被跟踪文件
svn add /path/to/file
hg add /path/to/file
git add /path/to/file

4,移除被跟踪文件
svn rm /path/to/file
hg remove /path/to/file
git rm /path/to/file

5,生成补丁
svn diff  >patch_file
hg diff >patch_file
git diff >patch_file

6,提交更改
svn commit
hg commit
git commit

6,查看当前状态
svn info
hg status
git status

7,查看修订记录
svn log
hg log
git log

8,启动服务器
svnserve -d
hg serve -p 8002 &
git daemon –base-path=/path/to/repo –export-all &

阅读(1110) | 评论(0) | 转发(0) |
0

上一篇:svn note

下一篇:gtest

给主人留下些什么吧!~~