mac 上代码托管到svn和github

本文详细介绍如何使用GitHub和SVN进行代码托管,包括GitHub的基本操作流程、SVN的配置及命令行操作详解。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.托管到github,免费版的没有加密,对所有人都开放,企业的话需要交钱,为了软件的安全性,没什么的好说的,安装官方操作就OK,

github 操作

echo "# sedge" >> README.md

git init

git add README.md

git commit -m "first commit"

git remote add origin https://github.com/leechance/sedge.git

git push -u origin master

需要注意的是

1需要在所要上传的项目的目录下执行以上操作

2git add 需要执行多次,当以上木下有多个子目录


以下是转载

http://www.07net01.com/2015/08/895617.html

一.首先你需要做的

首先你需要做的是:

1.创建你的github账号:点击这里注册,像这样

这里写图片描述
这里写图片描述

然后填写你的账号密码啥的就可以了。

2.下载git客户端:点击这里

二.终端配置

1.打开终端,输入

cd~/.ssh

这个是检查你的ssh的是否存在的,如果存在,先将已有的ssh备份,或者将新建的ssh生成到另外的目录下(如果第一次配置一般都是不存在的),不存在,你将会看到如下:

这里写图片描述

接下来你就需要用默认的参数生成ssh,终端输入

ssh-keygen-trsa-Cxxxxx@gmail.com

这里的xxxxx@gmail.com就是你注册github时的邮箱地址,比如我的是chw_loveway@163.com,那么我的终端就应该输入

ssh-keygen-trsa-Cchw_loveway@163.com

然后一直回车,直到这样

这里写图片描述

如果要修改ssh生成目录,在粗体位置处输入要生成的路径,选择默认的话,会生成在~/.ssh

2.打开你的github,按着下面的步骤

这里写图片描述

点击左侧的SSH keys然后添加

这里写图片描述

上面的
Title:填写你注册的邮箱号,这里就是chw_loveway@163.com
key:填写你的生成的id_rsa.pub文件将里面的内容copy到此

找不到id_rsa.pub的话就将你刚才的位置,也就是

这里写图片描述

copy到前往即可

这里写图片描述

这里写图片描述

选择文本编辑打开即可。

3.测试一下你的账号跟github连上了没有,打开终端,输入

ssh -Tgit@github.com

如果出现

Hi Loveway! You'vesuccessfully authenticated, but GitHub doesnotprovide shellaccess.

就表示你已经连上了,如图

这里写图片描述

三.上传代码到github

登录到github,然后点击+,选择New repository如图

这里写图片描述

然后会跳到下面这个界面

这里写图片描述

这里需要填写的有

Repository name:你自己建的工程的名字
Description:对你上传工程的一个简单的描述
Public:选择的是所有人都可见
Private:可以设置你指定的人可见
这里我们一般选择的就是Public,根据自己需要你可以选择Private
下面的
Initialize this repository with a README:就是给你的工程初始化一个README(工程的用法简介之类的)的一个文件,这里我们不选,到后面自己创建。
然后点击Create repository到下个界面,如图

这里写图片描述

到这里你就不需要做什么了,按着红色框里面的步骤来就可以了,打开终端,输入

echo"# CHWSwift">> README.md git init...

如图

这里写图片描述

刷新你的github你就可以看到了

这里写图片描述

四.修改你的github工程

你可以这样做,点击github右下角的Clone in Desktop

这里写图片描述

将文件保存到本地,这里我就设置路径为桌面,放在桌面上了,然后我就往里面添加了一张图片

如图我添加一张图片Swift_logo.png

这里写图片描述

然后看看我的github客户端点击changes,就会发现新增了一个图片,然后填上描述(比如我这里写的是second commitadd picture)提交

这里写图片描述

然后就如图点击History就可以看到你的历史提交记录,这里我们会发现我刚才提交的也就是second commit后面有一个圆圈,这个的意思就是还没有同步到github上去,点击右上角的Sync,就可以同步了,这一步不要忘记,不然你在github上看不到你的更新,如图

这里写图片描述

然后刷新我们的工程主页,就可以看到提交的更新了

这里写图片描述

五.最后

有的童鞋问我怎么删除github上的工程,其实这个删除有点不一样,具体就是到你的工程页面,点击右侧下面的Setting

这里写图片描述

进入下一个页面,到最底部,点击Delete this repository然后输入你的工程名,也就是你要删除的工程名字就行了(比如我这里就是CHWSwift

这里写图片描述

这里写图片描述

2.使用Xcode下的svn 操作
1首先服务器端要配置好svn ,建立代码仓库,和用户
2其次客户端mac 也要做好相应的配置
其配置如下

需要注意事项
1>源目录必须去掉git目录,执行 ls ---- rm -rf .git否则不能有效的进行commit和update操作
2>需要上传的代码必须做一下配置,不需要每个文件都进行托管
3>关于commit 和update,checkout
1>在commit之前必须进行update
2>创建目录的时候本地磁盘必须进行创建,工程再进行引用
3>目录名或者文件名进行改名字引起的冲突,旧有的文件名或者目录名,若果引起冲突必须进行discharge
4>checkout 可以在终端操作或者Xcode下都可以
5>已经有的文件,想要转移至其他目录,必须现在本地磁盘的目录下进行转移,然后工程中进行引用,一个文件可以存在磁盘多个目录下,但是工程目只能引用一份
6>可以某几个文件进行update和commit操作和discharge操作

转载:http://blog.sina.com.cn/s/blog_68661bd80101phpy.html

这两天响应老板要求,把所有代码放到公司的SVN服务器上,按照我的想法肯定是就苹果组建一个服务器,然后内部版本控制,自带的Xcode就有这个功能,之前也这么做过,但是xcode4.X系列SVN还是很好用,自从升级到Xcode5之后还没弄过。今天试了一下午还是没完全明白,眼看弄不出来,就直接用命令行了,不过一些简单的东西还是试出来了。

1.如何使用Xcode5 <wbr>SVN从公司服务器 check out项目</wbr>

iOS开发XCODE5<wbr>SVN配置<wbr>使用办法

iOS开发XCODE5<wbr>SVN配置<wbr>使用办法

  1. Choose Source Control > Check Out.

  2. Select the repository you want to check out, and click Next.

    You can select your repository from the Repositories tab, the Favorites tab, or the Recents tab. If you know the location of the repository you want to check out, you can also enter the address manually.

  3. If Xcode is unable to automatically identify the trunk and branches, use the browser window to select the correct project location, and click Next.

  4. In the Checkout window, select the branches and working copies to check out, and click Next.

    You will be presented only with the necessary options for your repository. If your project contains only one working copy, you will only have to select the branch to checkout. If your project doesn’t contain branches, you will only be given an option of working copies to checkout. If you project is a single working copy with no branches, this dialog will be skipped entirely.

  5. Select the location to store the working copy, and click Check Out.



2.当有修改时,在Source Control里面可以做点什么,我试了下commit,可以提交到本地,但是没有提交到服务器,中间包括-1012错误,然后配置git用户名跟邮箱。然后填写版本注释,然后就提交,看似提交成功,服务器上却没有。

iOS开发XCODE5<wbr>SVN配置<wbr>使用办法


3.Push local changes:我点击了试试,就出来下面这个,我有点疑惑,后来发现人家是

<wbr></wbr>push local changes to a remote git repository<wbr></wbr>

iOS开发XCODE5<wbr>SVN配置<wbr>使用办法

然后我就有点怀疑,难道Xcode自带的SVN的subversion类型不支持提交到服务器这个功能么。

然后看帮助文档,有这么一句。

If you’re using Subversion, a commit operation copies the changes from selected files into the remote Subversion repository. Therefore, you must be connected to the repository before you can commit changes. (For details, see your repository administrator.)

搞了半天不懂<wbr></wbr>see your repository administrator是什么意思。翻译出来是库管理员。我只想说看他有个毛用。我自能默默自嘲英文差。


4.然后我就想着再继续往下看。Updating or Pulling Changes from a Repository

如何更新和提交更改。然后就看到下面的内容。

Update your project with changes from the repository using the Source Control menu.

  • For a Git repository, choose Source Control > Pull.

  • For a Subversion repository, choose Source Control > Update.

  • For a project that contains both Git and Subversion repositories, choose Source Control > Update and Pull.

For projects with multiple repositories, select the ones you want to update.

Resolve differences by using the left and right buttons to specify which file’s contents to use.

After reconciling all differences, click Pull (Git) or Update (SVN) to complete the operation.

打开Source Control就没有找到Pull和Update。本来就英文差,他妈的刚巧就认得这几句,然后就此作罢。大牛莫要嘲笑我,还请告知我是哪里出了问题。

看了一个问答,XCODE5中怎么上传到SVN服务器,老外给出的结论是:两个办法,一个是用svn client,客户端软件;另一个方法是命令行。One way is using an svn client. The one which is obviously available is the command line svn client.

http://stackoverflow.com/questions/18894195/xcode-5-export-project-to-svn-repository


但是事情不能不做,就在网上找了命令实验了一下,尽可能写的详细点,下次看的时候好懂。随便帮帮跟我一样正在郁闷的人。





1.更改配置(不懂的话就直接跳过吧)

bogon:~ chenshuangchou$open ~/.subversion/config

启动配置文件,然后在配置文件中选择要忽略的文件类型

找到global-ignores一行,去掉注释,编辑成

global-ignores = build *~.nib *.so *.pbxuser *.mode *.perspective*

# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo


找到enable-auto-props = yes把注释去掉,在[auto-props] Section声明以下文本文件

*.mode* = svn:mime-type=text/X-xcode

*.pbxuser = svn:mime-type=text/X-xcode

*.perspective* = svn:mime-type=text/X-xcode

*.pbxproj = svn:mime-type=text/X-xcode


2.import命令

首先将本地代码import到版本库

bogon:~ chenshuangchou$svn import /Users/chenshuangchou/Desktop/BuickIOS/Buickhousekeeper <wbr>https://192.168.21.248:8443/svn/BuickIOS/ -m "initial import"</wbr>


3.checkout命令

然后从版本库checkout出来,这个目录就相当于被激活,内部跟服务器地址关联。

bogon:~ chenshuangchou$svn checkout https://192.168.21.248:8443/svn/BuickIOS/ /Users/chenshuangchou/Desktop/BuickIOS



4.add命令

当有新增的文件时用add指令,增加到版本库,然后提交

svn add /Users/chenshuangchou/Desktop/BuickIOS/Buickhousekeeper/ViewControllers/CarViewController/FuelManageViewController<wbr>/lastmouth_color1.png<wbr></wbr></wbr>

执行这条指令的前提是/Users/chenshuangchou/Desktop/BuickIOS/是从服务器checkout下来的目录,也就是is a working copy

新增成功的话会有

A<wbr>(bin)<wbr>Desktop/BuickIOS/Buickhousekeeper/ViewControllers/CarViewController/FuelManageViewController<wbr>/lastmouth_color1.png</wbr></wbr></wbr>



5.commit命令

提交内容到版本库

bogon:~ chenshuangchou$svn commit -m "添加了一个油耗柱状图" /Users/chenshuangchou/Desktop/BuickIOS/Buickhousekeeper/ViewControllers/CarViewController/FuelManageViewController<wbr>/lastmouth_color1.png</wbr>

提交到版本库成功的话,

Adding<wbr>(bin)<wbr>Desktop/BuickIOS/Buickhousekeeper/ViewControllers/CarViewController/FuelManageViewController<wbr>/lastmouth_color1.png</wbr></wbr></wbr>

Transmitting file data .

Committed revision 3.




6.update命令

更新版本库到本地,更新指定目录,svn update如果后面没有目录,默认将当前目录以及子目录下的所有文件都更新到最新版本。

bogon:~ chenshuangchou$svn update /Users/chenshuangchou/Desktop/BuickIOS1

更新成功

Updating 'Desktop/BuickIOS1':

A<wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/ViewControllers/CarViewController/FuelManageViewController<wbr>/lastmouth_color1.png</wbr></wbr></wbr>

Updated to revision 3.


回退到版本2: <wbr><wbr></wbr></wbr>

bogon:~ chenshuangchou$svn update -r 2 Desktop/BuickIOS1/

回退成功的话

Updating 'Desktop/BuickIOS1':

D<wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/ViewControllers/CarViewController/FuelManageViewController<wbr>/lastmouth_color1.png</wbr></wbr></wbr>

Updated to revision 2.


冲突

(更新,于版本库同步。如果在提交的时候提示过期的话,是因为冲突,需要先update,修改文件 ,然后清除svn resolved,最后再提交commit)

在提交时发生版本冲突会怎么样

bogon:~ chenshuangchou$svn commit -m "delegate中加入了一句话" /Users/chenshuangchou/Desktop/BuickIOS/

Sending<wbr><wbr><wbr><wbr>Desktop/BuickIOS/.git/index</wbr></wbr></wbr></wbr>

Sending<wbr><wbr><wbr><wbr>Desktop/BuickIOS/Buickhousekeeper/AppDelegate.h</wbr></wbr></wbr></wbr>

Sending<wbr><wbr><wbr><wbr>Desktop/BuickIOS/Buickhousekeeper.xcodeproj/project.xcworkspace/xcuserdata/chenshuangchou.xcuserdatad/UserInterfaceState.xcuserstate</wbr></wbr></wbr></wbr>

Transmitting file data ...

Committed revision 4.

bogon:~ chenshuangchou$svn commit -m "delegate中加入了一句不同的话" /Users/chenshuangchou/Desktop/BuickIOS1/

Sending<wbr><wbr><wbr><wbr>Desktop/BuickIOS1/.git/index</wbr></wbr></wbr></wbr>

svn: E160042: Commit failed (details follow):

svn: E160042: File or directory '.git/index' is out of date; try updating

svn: E160024:resource out of date; try updating

out <wbr>of<wbr>date表示版本过期,可能是由于另外的开发者更新了服务器版本,而本地代码与服务器冲突</wbr></wbr>


遇到这种情况,应该先从服务器update一下,然后再提交

bogon:~ chenshuangchou$svn update<wbr>Desktop/BuickIOS1/</wbr>

Updating 'Desktop/BuickIOS1':

Conflict discovered in '/Users/chenshuangchou/Desktop/BuickIOS1/.git/index'.

Select: (p) postpone,

<wbr><wbr><wbr><wbr>(mf) mine-full, (tf) theirs-full,</wbr></wbr></wbr></wbr>

<wbr><wbr><wbr><wbr>(s) show all options:<wbr></wbr></wbr></wbr></wbr></wbr>

在这里会有一个选择,选择(s)会显示所有选项的所有注释,如下

(s)<wbr>show all<wbr><wbr>- show<span style="word-wrap:normal; word-break:normal; line-height:16.5px; color:rgb(187,44,162)">this</span>list</wbr></wbr></wbr>

(e)<wbr>edit <wbr><wbr><wbr><wbr><wbr><wbr>- change merged file<span style="word-wrap:normal; word-break:normal; line-height:16.5px; color:rgb(187,44,162)">in</span>an editor</wbr></wbr></wbr></wbr></wbr></wbr></wbr>

(df) diff-full<wbr><wbr><wbr><wbr>- show all changes made to merged file</wbr></wbr></wbr></wbr>

(r)<wbr>resolved <wbr><wbr><wbr><wbr>- accept merged version of file</wbr></wbr></wbr></wbr></wbr>

(dc) display-conflict - show all conflicts (ignoring merged version)

(mc) mine-conflict<wbr><wbr>- accept my version<span style="word-wrap:normal; word-break:normal; line-height:16.5px; color:rgb(187,44,162)">for</span>all conflicts (same)</wbr></wbr>

(tc) theirs-conflict<wbr>- accept their version<span style="word-wrap:normal; word-break:normal; line-height:16.5px; color:rgb(187,44,162)">for</span>all conflicts (same)</wbr>

(p) postpone<wbr>- mark the conflict to be resolved later<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">。</span></wbr>

(mf) mine-full<wbr>- accept my version of entire file (even non-conflicts)</wbr>

(tf) theirs-full<wbr><wbr><wbr>- accept their version of entire file (same)</wbr></wbr></wbr>

选择一个之后会继续显示冲突点,直到完。而每一个点都会询问怎么处理。

G<wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper.xcodeproj/project.xcworkspace/xcuserdata/chenshuangchou.xcuserdatad/UserInterfaceState.xcuserstate</wbr></wbr>

Conflict discovered in '/Users/chenshuangchou/Desktop/BuickIOS1/Buickhousekeeper/AppDelegate.h'.

Select: (p) postpone, (df) diff-full, (e) edit,

<wbr><wbr><wbr><wbr>(mc) mine-conflict, (tc) theirs-conflict,</wbr></wbr></wbr></wbr>

<wbr><wbr><wbr><wbr>(s) show all options: tf</wbr></wbr></wbr></wbr>

G<wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/AppDelegate.h</wbr></wbr>

Updated to revision 4.

选择tf之后,冲突点会被服务器上的代码覆盖,自己本地代码会永久不见。最好先选择postpone,确定之后再修改。

关于冲突,可以参考:http://www.logicaltrinkets.com/wordpress/?p=178





7.status命令

查看文件或者目录状态

svn status path(目录下的文件和子目录的状态,正常状态不显示)

?:不在svn的控制中;M:内容被修改;C:发生冲突;A:预定加入到版本库;K:被锁定

svn status -v path显示所有文件的修改信息,在查看状态的同时,显示本地当前版本号,最后一次修改的版本号和修改人,分别在前

bogon:~ chenshuangchou$svn status<wbr>Desktop/BuickIOS1/</wbr>

M <wbr><wbr><wbr>Desktop/BuickIOS1/.git/index</wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/.git/objects/1c/7d8324a67dcd866bd0b4122b<wbr>01b924a0e77128</wbr></wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/.git/objects/75/1826a72a4afd4b15faf73a0b<wbr>6e4166d3bbec01</wbr></wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/.git/objects/a4/1c23190a65cda6a64a95bef2<wbr>2a9264ad64d90e</wbr></wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/.git/objects/b3/df5dbb592745d9744adf7a32<wbr>ed2bb39370c78e</wbr></wbr></wbr></wbr>

M <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/AppDelegate.h</wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/lastmouth_color1.png</wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/lastmouth_color2.png</wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/lastmouth_color3.png</wbr></wbr></wbr>

? <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper/lastmouth_color4.png</wbr></wbr></wbr>

M <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper.xcodeproj/project.pbxproj</wbr></wbr></wbr>

M <wbr><wbr><wbr>Desktop/BuickIOS1/Buickhousekeeper.xcodeproj/project.xcworkspace/xcuserdata/chenshuangchou.xcuserdatad/UserInterfaceState.xcuserstate</wbr></wbr></wbr>



8.delete命令

svn delete path -m " delete test fle "<wbr></wbr>

删除一个空白的文件夹:

bogon:~ chenshuangchou$svn delete /Users/chenshuangchou/Desktop/BuickIOS/branches<wbr></wbr>

D <wbr><wbr><wbr><wbr>Desktop/BuickIOS/branches</wbr></wbr></wbr></wbr>

显示删除成功




9.log命令

查看版本记录,也叫日志

bogon:~ chenshuangchou$ svn log /Users/chenshuangchou/Desktop/BuickIOS

------------------------------------------------------------------------

r3 | chensc | 2013-10-31 11:34:03 +0800 (, 31 10 2013) | 1 line


添加了一个油耗柱状图

------------------------------------------------------------------------

r2 | chensc | 2013-10-28 12:00:36 +0800 (, 28 10 2013) | 1 line


initial import

------------------------------------------------------------------------

r1 | VisualSVN Server | 2013-06-28 17:40:29 +0800 (, 28<wbr>6 2013) | 1 line</wbr>


Initial structure.


只有两个版本记录,说明第二个版本和第三个版本未添加版本说明,也就是在执行指令时未添加-m<wbr></wbr>,这个指令是添加注释



10.diff命令

svn diff path(将修改的文件与基础版本比较)

在上传版本时,可能有自己版本与服务器版本不一致,需要查看具体代码,这个命令就可以做到

svn diff -r m:n path

对版本m和版本n比较差异

在追溯版本问题时,这个命令也十分有用

bogon:~ chenshuangchou$svn diff /Users/chenshuangchou/Desktop/BuickIOS1

--- /Users/chenshuangchou/Desktop/BuickIOS1/Buickhousekeeper/AppDelegate.h (revision 4)

+++ /Users/chenshuangchou/Desktop/BuickIOS1/Buickhousekeeper/AppDelegate.h (working copy)

@@ -6,6 +6,7 @@

<wbr>//<wbr>Copyright (c) 2013<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">年</span>calinks. All rights reserved.</wbr></wbr>

<wbr>//</wbr>测试的很好

<wbr></wbr>

+

<wbr>#import</wbr>

<wbr>#import "BMapKit.h"</wbr>

<wbr></wbr>

@@ -15,7 +16,7 @@

<wbr>- (void)refreshIdeaMessage;</wbr>

<wbr></wbr>

<wbr>- (void)refreshMaintainMessage;</wbr>

-@end

+@end<wbr></wbr>





11.merge命令

将两个版本之间的差异合并到当前文件

bogon:BuickIOS chenshuangchou$svn merge -r 4:5 /Users/chenshuangchou/Desktop/BuickIOS/Buickhousekeeper/AppDelegate.h

一般会发生冲突,处理冲突

— /Users/chenshuangchou/Desktop/BuickIOS/Buickhousekeeper/svn-1FUb4k10 31 15:36:15 2013

+++ /Users/chenshuangchou/Desktop/BuickIOS/.svn/tmp/AppDelegate.h.tmp10 31 15:36:16 2013

@@ -4,8 +4,13 @@

<wbr>//<wbr>Copyright (c) 2013<span style="word-wrap:normal; word-break:normal; line-height:normal; font-family:'Heiti sC Light'">年</span>calinks. All rights reserved.</wbr></wbr>

-//测试的很好

+<<<<<<< .working

+//测试一下

+=======

+//验证版本差异合并

+>>>>>>> .merge-right.r5





12.ls命令

版本库下的文件和目录列表

svn list path显示path目录下的所有属于版本库的文件和目录

bogon:BuickIOS chenshuangchou$svn ls https://192.168.21.248:8443/svn/BuickIOS/

.git/

Buickhousekeeper/

Buickhousekeeper.xcodeproj/

DevOneSDK.framework/

branches/

tags/

trunk/






13.log命令

查看文件详细信息

bogon:~ chenshuangchou$svn info /Users/chenshuangchou/Desktop/BuickIOS/Buickhousekeeper/AppDelegate.h<wbr></wbr>

Path: Desktop/BuickIOS/Buickhousekeeper/AppDelegate.h

Name: AppDelegate.h

Working Copy Root Path: /Users/chenshuangchou/Desktop/BuickIOS

URL: https://chensc@192.168.21.248:8443/svn/BuickIOS/Buickhousekeeper/AppDelegate.h

Repository Root: https://chensc@192.168.21.248:8443/svn/BuickIOS

Repository UUID: 9a03820f-37b7-b94a-a594-74c58a350bc6

Revision: 4

Node Kind: file

Schedule: normal

Last Changed Author: chensc

Last Changed Rev: 4

Last Changed Date: 2013-10-31 14:04:51 +0800 (, 31 10 2013)

Text Last Updated: 2013-10-31 14:02:51 +0800 (, 31 10 2013)

Checksum: 83d8a08d317af33501b65051<wbr>7aa4033d5fe9f0d4</wbr>


14.其它命令

svn mkdir:创建纳入版本控制下的新目录。

用法:1mkdir PATH...

2mkdir URL...

svn revert:恢复原始未改变的工作副本文件(恢复大部份的本地修改)revert:

用法: revert PATH...

注意:本子命令不会存取网络,并且会解除冲突的状况。但是它不会恢复

被删除的目录

svn switch(sw):更新工作副本至不同的URL

用法:1switchURL [PATH]

<wbr><wbr><wbr>2</wbr></wbr></wbr>switch--relocate FROM TO [PATH...]

svn resolved:移除工作副本的目录或文件的冲突状态。

用法: resolved PATH...

注意:本子命令不会依语法来解决冲突或是移除冲突标记;它只是移除冲突的

相关文件,然后让PATH可以再次提交。

svn cat输出指定文件或URL的内容。

svn cat目标[@版本]...如果指定了版本,将从指定的版本开始查找。

svn cat -r PREV filename > filename (PREV是上一版本,也可以写具体版本号,这样输出结果是可以提交的)




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值