Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2604297
  • 博文数量: 877
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5920
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-05 12:25
个人简介

技术的乐趣在于分享,欢迎多多交流,多多沟通。

文章分类

全部博文(877)

文章存档

2021年(2)

2016年(20)

2015年(471)

2014年(358)

2013年(26)

分类: iOS平台

2015-11-13 19:38:55

http://blog.csdn.net/zhtsuc/article/details/42795901

SSH Keys


SSH key 可以让你在你的电脑和 Git @ OSC 之间建立安全的加密连接。

你可以按如下命令来生成sshkey

ssh-keygen -t rsa -C "xxxxx@xxxxx.com"# Creates a new ssh key using the provided email
# Generating public/private rsa key pair...

查看你的public key,并把他添加到 Git @ OSC 

cat ~/.ssh/id_rsa.pub
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....

添加后,在终端(Terminal)中输入

ssh -T git@git.oschina.net

若返回

Welcome to Git@OSC, yourname! 

则证明添加成功

然后可以开始提交,并建立和server端的联系


$ git remote add origin git@git.oschina.net:workspace/hello-world.git  
$ git push -u origin master 



可能的错误

$ git remote add origin git@git.oschina.net:workspace/hello-world.git

错误提示:fatal: remote origin already exists.

解决办法:

$ git remote rm origin

然后在执行:git remote add origin git@git.oschina.net:workspace/hello-world.git  就不会报错误了
阅读(651) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~