使用git将代码push到osc上

1、下载git客户端

2、在osc上创建项目

①使用:git bash here

②在目录下执行:git init

③ssh-keygen -t rsa -C "xqs@gmail.com"这里替换成自己的用户名(就是你的osc账号)

④Enter file in which to save the key (/Users/diaosi/.ssh/id_rsa):xinqin(输入自己要保存的名字)接下来还要输入密码自己设置随意。

⑤打开/Users/diaosi/.ssh/会看到生成了xinqin和xinqin.pub文件,打开xinqin.pub文件拷贝内容在osc的部署公用密钥上添加即可。

⑥命令行git pull https://git.oschina.net/uustudy/xinqin.git(提示输入账号和密码,邮箱+密码)

⑦命令行git push https://git.oschina.net/uustudy/xinqin.git(提示输入账号和密码,邮箱+密码)

问题列表:

fatal: Not a git repository (or any of the parent directories): .git

提示说没有.git这样一个目录,解决办法如下:命令行里输入git init就可以了!

debug1: Authentication denied(publickey).还有说你没有权限之流,看看key添加成功了吗?

命令行:ssh -T git@git.oschina.net

另外直接用https吧,麻烦点就是每次要输入用户名和密码

 

posted @ 2016-03-05 19:08  逆水寒龙  阅读(548)  评论(0编辑  收藏  举报