svn 常用
- svn 版本庫拉取
svn co svn://192.168.0.22/mysvn #後面不更任何目錄代碼更新到命令當前所在的目錄
svn co svn://192.168.0.22/mysvn /var/www #更新到/var/www 目錄
或者
svn checkout svn://192.168.0.22/mysvn (同上 co 是 checkout 的縮寫)
- svn 本地更新到某個版本
svn up #更新當前所在的目錄
svn up ./user.php #更新user.php 文件
svn up /var/www/aa #更新 /var/www/aa
- svn 增加文件
svn add . #增加當前目錄到版本庫
svn add a.php #增加a.php到版本庫
- svn 提交
svn commit -m 'test' #提交代碼
git 常用
- git 版本庫拉取
git clone http://192.168.0.22/a.git
- git 本地更新到某個版本
git pull .
git pull a.php
- git 增加
git add a.php
git add .
- git 查看狀態
git status
- git 提交
git commit -m "first commit" #git commit後需要提交
git push #默認提交
git push origin master //提交master 分支
git svn 混合用
下面是一個git-svn的一般使用流程:
1、git-svn clone svn_repository
2、修改本地代碼,使用git add/commit將修改提交到本地git庫
3、定期使用git-svn rebase獲取中心svn repository的更新
4、使用git-svn dcommit命令將本地git庫的修改同步到中心svn庫
http://svnbook.red-bean.com/en/1.7/svn.branchmerge.using.html
svn copy sourceURL branchURL
Then, switch to that branch:
svn switch branchURL
And commit your changes:
svn commit
svn switch –relocate http://svn.example.com/path/to/repository/path/within/repository http://svnnew.example.com/new/repository/path/within/repository
deepxl 十一月 10th, 2017