SVN命令备忘录 - 冯校长
SVN命令备忘录
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
svn diff Script/activity/CannonKing.js -r208:209
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
svn cp -m \’create branch\’ http://www.svnchina.com/svn/bobo_game/mrsd http://www.svnchina.com/svn/bobo_game/mrsdfb
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
svn merge http://www.svnchina.com/svn/bobo_game/mrsd/Script ./Script
GIT相关命令
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
p.p1 { margin: 0; font: 11px Menlo; color: rgba(0, 0, 0, 1); background-color: rgba(255, 255, 255, 1) }
span.s1 { font-variant-ligatures: no-common-ligatures }
git checkout en script/base/Util.js
git通配符
git status *.lua//单个的情况
git status *.{lua,cs}//多个的情况
git status * | egrep “.lua|.prefab”
全体合并
git merge en
清除本地新增
git clean -df
删除本地分支
git branch -D developer/xxx
删除远程分支
git push origin –delete developer/xxx
拉取远端分支
git checkout -b developer/xxx(本地分支名称) origin/developer/xxx(远端分支名称)
更新并合并到本地
git pull origin cn_dev
提交
git push origin HEAD:developer/xxx
解决冲突
git checkout –theirs[mine] Assets/GameMain/UI/UIForms/WorldMap/WorldMapPanel.prefab
撤销add
git reset Assets/GameMain/Scripts/DataTableNewGen/WorldIntercontinentalCfg.pb.cs
撤销commit
git revert <commit_id>
git push
revert后要push
查看一次提交的内容(某文件)
git show d6d34bf0d36774b86603cf0cf1be8143364b962a Assets/GameMain/Scripts/Story/StoryCommand/StoryCommand.cs
查看一次提交了哪些文件
git whatchanged d6d34bf0d36774b86603cf0cf1be8143364b962a
查看某作者的log
git log –author=”fengkerong”
更改分支名字
git branch -m old_name new_name
查看已add的修改
git diff –cached Assets/GameMain/Scripts/UI/Login/LoginServerPage.cs
回退至某次提交
git reset –hard e35b93ef1d709156a4fa6c1260c45e9d2668c84f
后强推至远端
git push -f -u origin developer/fengkerong/1_92
解决分支冲突
git pull : error: cannot lock ref \’refs/remotes/origin/*\’ (unable to update local ref)
-
git gc –prune=now
-
git remote prune origin
-
git pull
$ ssh-keygen //生成SSH密钥z指令(采用ssh协议通讯时)
git clone url //下载服务器上的代码到本地,url为代码的地址‘
git branch branchName//创建一个名为branchName的分支,但不切换到该分支
git checkout -b branchName //创建一个名为branchName的分支并切到该分支
git checkout -b branchName —track origin/branchName //在本地创建一个名为branchName的分支,同时自动绑定服务器上的该分支
git pull origin/branchName //从远端更新代码带本地,并自动merge代码
git merge branchName //合并branchName分支的代码,将其合并到当前分支
git branch -a //查看所有分支信息,包括远端分支
git add * //将当前文件 夹下的本地更改和添加的新文件进行保存
git add filePath //将filePath下的文件的本地更改和添加的新文件进行保存
git rm * //将当前文件夹下的已删除文件的删除操作保存
git rm filePath //将filePat h下的已删除文件的删除操作保存
git diff filePath //查看filePath下的文件修改内容
git diff //查看距离上次git add 操作之前的所有修改过的文件的修改内容
git status //查看当前项目距离上次git add 操作之后的所有的修改,删除,新加的文件路径和名称
git checkout * //将当前文件夹下的文件操作还原到上次git add 之前
git checkout filePath // 将filePath下的文件的修改操作还原到上次git add 之前
git commit -m “” //将本地更改提交
git push origin branchName //将本地更改推送到远端服务器
git reflog // 查看log信息
git reset —hard versionNumber // 强制将代码还原到某个版本,特别慎用,因为有可能会损坏其他人的代码修改
git 子模块
git submodule add url //将一个仓库当作子模块加载到当前仓库里,url为作为子模块被加进来作为子模块的仓库
git submodule update //更新子模块,更新子模块的另外一个方法,是进入到子模块所在的文件夹,然后像修改普通的git的仓库的方式进行更新和切换分支
git submodule init //下载服务器上的子模块到本地
git行尾符
git config –global core.autocrlf true //提交时转换为LF,检出时转换为CRLF
git config –global core.autocrlf input //提交时转换为LF,检出时不转换
git config –global core.autocrlf false //提交检出均不转换
git config –global core.safecrlf true //拒绝提交包含混合换行符的文件
git config –global core.safecrlf false //允许提交包含混合换行符的文件
git config –global core.safecrlf warn //提交包含混合换行符的文件时给出警告