使用git客户端第一次git clone github.com代码的方法
2015-07-28 17:04
681 查看
使用git客户端第一次git clone github.com代码的方法
使用git-clone命令从github上同步github上的代码库时,如果使用SSH链接,而你的SSH key没有添加到github帐号设置中,系统会报下面的错误:Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这时,需要在本地创建SSH key,然后将生成的SSH key文件内容添加到github帐号上去。创建ssh key的过程如下:
输入命令:
ssh-keygen -t rsa -c "youremail@xx.com"
然后根据提示连按三次enter键,生成的SSH key文件就保存到C:\Users\Administrator.ssh文件夹下的id_rsa.pub文件中。
如图所示:
用文本工具打开id_rsa.pub文件,复制其内容。将其粘贴到github账号下的SSH key中。
登陆自己的github账号,选择“setting”选项,添加SSH key.如图所示:
然后就可以clone自己的github上的代码了。
git clone命令:
git clone git@github.com:Jameszhjj/W3C.git
git add命令:
git add -A
git commit命令:
git commit -m " "
git push命令:
git push (origin master)(括号内可选)
相关文章推荐
- Python判断变量类型
- 分析java.lang.NullPointerException thrown in RelativeLayout measure()
- Java无限级树(递归)超实用
- Lua强大的元方法__index
- [php] 二维码
- zend studio(Eclipse)和PyDev搭建Python开发环境
- SpringMVC在控制器Controller里面读取国际化message文件里面的值
- JAVA-System.arraycopy方法的使用
- python学习
- php面向对象之final static const关键字的使用
- MyEclipse图表工具Birt的使用技巧(二)--cross tab的使用
- 代码大全2-软件构建中的设计
- 一个 go 文件服务器 ssdb
- java.lang.IllegalArgumentException: Wrong FS: expected: file:/// – Hadoop
- GitHub详细教程
- MyEclipse 使用技巧
- 关于static在java和c++中的用法小谈(二)
- spring环境搭建以及和struts整合
- golang 中的定时器(timer),更巧妙的处理timeout
- Java 反射