Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1471837
  • 博文数量: 263
  • 博客积分: 10851
  • 博客等级: 上将
  • 技术积分: 2627
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-26 22:40
文章分类

全部博文(263)

文章存档

2013年(4)

2012年(25)

2011年(33)

2010年(50)

2009年(138)

2008年(13)

分类: LINUX

2011-07-11 10:25:58

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
 
5. 移除被跟踪文件
 svn rm /path/to/file
 hg remove /path/to/file
 git rm /path/to/file
 
6. 生成补丁
 svn diff  >patch_file
 hg diff >patch_file
 git diff >patch_file
 
7. 提交更改
 svn commit
 hg commit
 git commit
 
8. 查看当前状态
 svn info
 hg status
 git status
 
9. 查看修订记录
 svn log
 hg log
 git log
 
10. 启动服务器
 svnserve -d
 hg serve -p 8002 &
 git daemon –base-path=/path/to/repo –export-all &
阅读(938) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~