http://www.cnblogs.com/wengzilin/p/3530712.html
来源:互联网 发布:淘宝开店认证要多久 编辑:程序博客网 时间:2024/05/10 11:27
【转】Xcode托管代码到oschina中的教程
Xcode 已经集成了git,建立新项目时钩选使用git,然后按照下面步骤让Xcode和git@osc 建立连接。
第一步:成生SSH密钥
打开终端命令工具,输入命令:ssh-keygen -t rsa -C "diaosi@gmail.com"
注意ssh-keygen没有空格。屏幕输出:
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/diaosi/.ssh/id_rsa):diaosi
在上方输入生成的密钥文件名,如diaosi,屏幕输出:
Enter passphrase (empty for no passphrase): 输入密码
Enter same passphrase again: 确认密码
Your identification has been saved in diaosi.
Your public key has been saved in diaosi.pub.
The key fingerprint is:
25:fd:01:00:89:98:49:bf:2e:ac:32:2e:d2:5d:bf:98 diaosi@gmail.com
The key's randomart image is:
+--[ RSA 2048]----+
| ..+ ..o... |
| +.. . . . |
| . . o . |
| . o . . |
| . S . |
| . . . |
| .o... . |
|=.... o. |
|*o E .. |
+-----------------+
屏幕提示生成密钥文件成功,保存在/Users/diaosi文件夹下。
第二步:把diaosi.pub中的内容加入git@osc 的SSH密钥中
第三步:添加SSH并连接
输入命令:ssh-add ~/diaosi
~/diaosi 是刚刚生成的密钥文件路径,屏幕输出:
Enter passphrase for /Users/diaosi/diaosi:输入密码
Identity added: /Users/diaosi /diaosi (/Users/diaosi /diaosi)
输入命令ssh -T git@git.oschina.net,屏幕输出:
The authenticity of host 'git.oschina.net (58.215.179.44)' can't be established.
RSA key fingerprint is 14:b8:b8:0b:c2:b2:5e:ae:f2:21:f8:18:4d:3a:be:fc.
Are you sure you want to continue connecting (yes/no)? yes(输入yes),屏幕输出:
Warning: Permanently added 'git.oschina.net,58.215.179.44' (RSA) to the list of known hosts.
Welcome to Git@OSC , 老左!
第四步:设置个人信息
输入命令:
git config –global user.name “diaosi” (有两个-号)
git config –global user.email diaosi@gmail.com
第五步:设置项目
获取git@osc 上的项目路径。
输入命令:cd 项目文件夹
输入命令:git remote add origin git@git.oschina.net:heqings/fitness.git
输入命令:git pull -u origin master //从git@osc 上拉取项目
输入命令:git push -u origin master //提交项目
第六步:Xcode集成
在Xcode中,提交代码到git@osc 前需提交到本地git,否则Xcode会提示你。
在项目或文件上选择文件提交到本地,这里需要注意的是,工程用户数据不要提交到git,因它实时在变化,本地和远程都不要提交,否则Push时提示有文件未提交。
以上文件不要提交。
把项目提交到本地:
File->Source Control->Commit
把项目提交到git@osc :
File->Source Control->Push
点击Push按钮即可。
=====================
若xcode工程在当时新建的时候没有勾选git也没事,几句话就可以在现有的工程中建立git管理:
cd到工程目录:
git init
git add .
git commit -m ‘initial’
====================
移除现有的git控制:
rm -fr .git
====================
git经常遇到的错误:
pull is not possible because you have unmerged files
解决方法见:http://halolk.blog.51cto.com/6916369/1304701
我的解决方法是,git commit -a
====================
oschina & xcode:里面的所有username都是指邮箱中@前的字符串,比如ABC@163.com中的ABC
- http://www.cnblogs.com/wengzilin/p/3530712.html
- http://www.cnblogs.com/flylovesky/p/3274869.html
- http://www.cnblogs.com/ada-zheng/p/3284660.html
- http://www.cnblogs.com/zhanghaiba/p/3548602.html
- http://www.cnblogs.com/scy251147/p/3566638.html
- http://www.cnblogs.com/amosli/p/3577645.html
- http://www.cnblogs.com/VisualImage/p/3594973.html
- http://www.cnblogs.com/kuangbin/p/3164106.html
- http://www.cnblogs.com/qingjoin/p/3549325.html
- http://www.cnblogs.com/interdrp/p/3785164.html
- http://www.cnblogs.com/ruiati/p/3930732.html
- http://www.cnblogs.com/knowledgesea/p/3491214.html
- http://www.cnblogs.com/ganganloveu/p/3755191.html
- http://www.cnblogs.com/kenshincui/p/3885689.html
- http://www.cnblogs.com/lanxuezaipiao/p/3440471.html
- http://www.cnblogs.com/wangfupeng1988/p/4001284.html
- http://www.cnblogs.com/kissazi2/p/4133927.html
- http://www.cnblogs.com/dojo-lzz/p/3722003.html
- x4412开发板&ibox卡片电脑项目实战15-移植第一个hello x4412内核驱动
- 前方有雾--葡桃
- 第七周项目1电阻串联
- UIUC同学Jia-Bin Huang收集的计算机视觉代码合集
- 生成元
- http://www.cnblogs.com/wengzilin/p/3530712.html
- OK6410 TFTP的安装以及TFTP下载zImage映像
- mysql中unique key与auto_increment的性能分析
- checkbox复选框全选及全不选操作,attr无效解决办法
- Centos搭建SVN服务器三步曲
- x4412开发板&ibox卡片电脑项目实战16-将hello x4412驱动编译成模块
- 命题真值判断代码
- C++中引用和指针的区别
- 留学垃圾--葡桃