1 git  clone  github仓库地址

2 git add .

3 git  commit -m "changes log"

4 git remote add origin http://git地址

4 git push -u origin master

http://jingyan.baidu.com/article/f7ff0bfc7181492e27bb1360.html

错误1:git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.

Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

出现这个问题是因为,没有在github账号添加SSH key

解决方法如下

在终端输入。

ssh-keygen -t rsa -C "forwhat.cn"//注意。forwhat.cn为用户名

如果执行成功。返回

Generating public/private rsa key pair.
Enter file in which to save the key (/home/forwhat.cn/.ssh/id_rsa): 
在这里就是设置存储地址了.反正我是直接按的回车

然后还会返回

Enter passphrase (empty for no passphrase):

再次直接回车。
Enter same passphrase again:

再次回车。

Your identification has been saved in /home/forwhat.cn/.ssh/id_rsa.
Your public key has been saved in /home/forwhat.cn/.ssh/id_rsa.pub.
The key fingerprint is:
这里有一串数。我把他屏蔽了。
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|    o            |
|   + .  S        |
|  . = .  o       |
|   o + +o.o      |
|E o . o.=+.      |
|.+   ==+ooo.     |
+-----------------+
这样SSH key就生成了。直接cat一下就好了。

000000:~/a$ cat /home/forwhat.cn/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQ(我屏蔽了)

把显示出来的直接添加到github账户设置里边的SSH keys
。add.

回来在git pull

就开始远程拷贝代码了

 错误2:Updates were rejected because the remote contains work that you do not have

git pull origin master

http://blog.csdn.net/jackystudio/article/details/12309531

用git上传项目到github的更多相关文章

  1. 使用git上传项目到GitHub上

    之前的博客有<使用git拉取GitHub上的项目>的文章,那么现在说一下,如何上传项目到GitHub上. 1. Git的.gitignore 文档配置 因为项目中可能有很多的图片还有nod ...

  2. 用git上传项目到GitHub或者码云全过程

    用git上传项目到GitHub或者码云全过程 1. 会生成一个隐藏文件夹".git".这是一个不可删文件,因为暂存区和历史区还有一些其他的信息都在这里,删掉就不是一个完整的仓库了 ...

  3. Git 上传项目到 Github

    Git 上传项目到 Github 该文章主要讲解Git 上传项目到 Github,Gitee同理 配置Git 下载.安装Git 下载后一路(傻瓜式安装)直接安装即可 如果第一次使用git的话,需要设置 ...

  4. 直接利用本地git上传项目到github

    http://m.blog.csdn.net/article/details?id=50441442 本文将详细介绍如何托管你的项目到github上   转载请标明出处: http://blog.cs ...

  5. git上传项目到github简易步骤

    第一步: 在github创建仓库,创建完成进入该仓库,仓库地址如:https://github.com/winerss/wcMall格式 第二步:使用git,cd到本地项目目录下,执行git明令: g ...

  6. git上传项目到github远程库

    最近在学习使用 git 上传管理项目,依照教程,建好了一个远程库,也实现了本地库与远程库的项目同步上传,但是在试着将本地库里的项目上传到另一个新建远程库时遇到了问题,一直上传不成功,经过一番查找摸索终 ...

  7. 利用Git上传项目到github以及遇到的问题

    今天学习如何利用git从本地端上传项目,以及遇到问题的解决方法 1.要有自己的github账号,并创建一个仓库, 2.输入仓库的名称,直接Create 注:记住常见成功后的这个地址,后边要用到: 3. ...

  8. 使用Git上传项目到GitHub仓库

    GitHub账号注册很长时间了,但是没怎么上传过东西.今天学习如何利用Git工具将代码上传到GitHub,了解了一些常用命令 $ git config --global user.name " ...

  9. Git上传项目到GitHub

    1.注册账户 https://github.com/ 2.创建仓库 3.需要安装 Git   http://msysgit.github.com/ 4.本地创建ssh key(不是必要,不创建ssh可 ...

  10. 使用git上传项目到github

    来自: http://www.cnblogs.com/specter45/p/github.html GitHub是基于git实现的代码托管.git是目前最好用的版本控制系统了,非常受欢迎,比之svn ...

随机推荐

  1. CLLocation

    http://blog.sina.com.cn/s/blog_9e8867eb01013knc.html 这家伙写的不错本人也参考了这篇博客,希望原文博主可以谅解新手的无奈举措 首相要提到的类是 CL ...

  2. C++ try catch 捕获空指针异常,数组越界异常

    #include <exception> #include <iostream> using namespace std; /************************* ...

  3. Svn服务启动的两种方式

    一.svn服务器启动 › cmd命令行启动:vsvnserve -d –r 文档仓库路径 -d 后台执行 › -r 版本库的根目录 二.›Windows服务自动启动     利用xp.2000 以上的 ...

  4. mysql在查询结果中增加排序字段

    ELECT userId , () AS runRank , mostFast1 FROM user_info, ()) b WHERE mostFast1 IS NOT NULL ORDER BY ...

  5. C++中的栈和队列

    使用标准库的栈和队列时,先包含相关的头文件 #include<stack> #include<queue> 定义栈如下: stack<int> stk; 定义队列如 ...

  6. 解决jni链接时找不到函数的问题

    用jni调用库函数时,经常会碰到link的错误,具体出错信息如下: 08-07 01:42:06.490: E/AndroidRuntime(1665): java.lang.UnsatisfiedL ...

  7. 运行SPL Streams debugger(sdb)的两种方法

    You can use the SPL Streams Debugger in InfoSphere® Streams Studio to help you debug your SPL applic ...

  8. Weblogic安装NodeManager

    http://blog.sina.com.cn/s/blog_6ed936400100ytdo.html

  9. JavaScript基础(语法类型转换、运算符、语句)

    1.类型转换: 分为自动转换和强制转换,一般用强制转换. 其他类型转换为整数:parseint(): 其他类型转换为小数:parsefloat(): 判断是否是一个合法的数字类型:isNaN(): 是 ...

  10. Ubuntu_16.04 配置 Apache Rwrite URL 重写

    Ubuntu Apache配置Rwrite URL重写 0. apache目录