刚研究了一下 部署项目到osc记录一下以方便以后查找
1. 在osc创建项目

填写项目信息

当你安装完成git的时候,你需要简单的配置一下,打开终端:
用户名
第一步,你需要告诉git你的名字,这个名字会出现在你的提交记录中。
git config --global user.name "你的名字"
然后是你的Email,同样,这个Email也会出现在你的提交记录中,请尽量保持此Email和您的Git@OSC的注册Email一致。
git config --global user.email "你的Email"
2.生成密钥对
在终端输入onssh-keygen -t rsa -C "你的邮箱(注册osc的邮箱)"
查看公钥内容
在终端输入oncat .ssh/id_rsa.pub 会输出如下内容

复制该内容.然后进入osc网站点击头像

然后点击SSH公钥

在终端输入oncat .ssh/id_rsa.pub 测试SSH链接
回车后输入yes

3.上传本地项目
然后在你的需要初始化版本库的文件夹中执行
git init
git remote add origin <你的项目地址> //注:项目地址形式为:http://git.oschina.net/xxx/xxx.git或者 git@git.oschina.net:xxx/xxx.git
这样就完成了一次版本你的初始化
完成第一次提交
进入你已经初始化好的或者克隆项目的目录,然后执行
git pull origin master
git touch init.txt //如果已经存在更改的文件,则这一步不是必须的
git add .
git commit -m "第一次提交"
git push origin master
如果你想克隆一个项目到本地,只需要执行git clone <项目地址>
提交完项目
以后对项目修改和提交就可以直接在xcode中进行了

网友评论