书接上文Git常用命令-配置类
这一期我们来看一下Git命令中的引导类及外部系统交互指令。在实际的Git仓库运用之前可能存在某些场景需要导入导出CVS、SVN等版本控制文件进行管理,所以才有此篇外部系统交互指令介绍。
porcelain命令中的第三方交互命令:
git-cvsexportcommit:将Git中的一次提交导出到CVS签出,从而更容易将Git存储库中的修补程序合并到CVS存储库中
概要:
git cvsexportcommit [-h] [-u] [-v] [-c] [-P] [-p] [-a] [-d <cvsroot>]
[-w <cvs-workdir>] [-W] [-f] [-m <msgprefix>] [<parent-commit>] <commit-id>
常用命令:
git cvsexportcommit -v <commit-sha1>
![](https://img-blog.csdnimg.cn/img_convert/d97b7c5510889d913e675f27def9e861.gif)
git-cvsimport:将CVS存储库导入Git,这将创建一个新的存储库或者增量导入到现有的存储库中
概要:
git cvsimport [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
[-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
[-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
[-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
[-r <remote>] [-R] [<CVS_module>]
常用命令:
#先定义CVS库的位置
export CVSROOT=:pserver:[email protected]:/home/<main repository>
cvs login #登陆CVS
git cvsimport -v gitPath #将CVS的每次变动同步到gitPath
![](https://img-blog.csdnimg.cn/img_convert/b204b6f5b7ee5a7057cf4fed218086f4.gif)
git-cvsserver:通过Git模拟CVS服务端
概要:
git-cvsserver [<options>] [pserver|server] [<directory> …]
![](https://img-blog.csdnimg.cn/img_convert/eb0d38f852966aab642d18056fb46f52.gif)
上述指令,笔者也没有实际操作过,如果读者想要深入了解请翻阅官方文档。
git-svn:在Subversion版本库和Git之间的进行双向操作
概要:
git svn <command> [options] [arguments]
常用指令流:
git svn clone svnUrl #git从svn上下载项目
git add/commit #git提交文件到本地工作区
git svn dcommit #git提交到svn
git svn fetch #拉取SVN上的最新修改
git svn rebase #合并git和svn解决冲突,需要确定先git svn fetch防止svn上有未下载的提交
![](https://img-blog.csdnimg.cn/img_convert/9e59e1518e876c125fff575c63e22e9b.gif)
本期就到这,下一篇说一说Git文件操作类指令
![](https://img-blog.csdnimg.cn/img_convert/32a50f4edafb517b986c5d7e02442810.jpeg)