将本地项目放到GitHub上面

GitHub仓库与本地Git仓库传输是通过SSH加密的,我们先在本地生成一个私钥和一个密钥
2016-01-06 12:33:37屏幕截图
$ cd ~/.ssh
$ ssh-keygen -t rsa -C “longquangege@foxmail.com”
然后一直按回车,不用设置密码

打开生成的 id_rsa.pub文件 将里面的字符串复制到GitHub的SSH Keys 里面去
2016-01-06 12:34:27屏幕截图
2016-01-06 12:35:00屏幕截图

好了,接下来去GitHub上创建一个新的仓库。
2016-01-06 12:32:31屏幕截图
2016-01-06 12:35:55屏幕截图

回到你的本地仓库,按着上面的提示去操作就可以了
2016-01-06 12:40:22屏幕截图
第四步如果提示了错误
我们就先删除远程的分支再添加
$ git remote rm origin

记得选择SSH的地址,选HTTPS会提示错误

然后就没有然后了。。。

  9 comments for “将本地项目放到GitHub上面

  1. 2016-08-17 at 02:21

    You did it !

  2. 2016-08-17 at 02:41

    The youre really talented .

  3. 2016-08-17 at 05:21

    Not that I know of.

  4. 2016-08-17 at 07:36

    this can be a very helpful website!

  5. 2016-08-18 at 04:08

    Good !|Cool! I love your this bolg.

  6. 2016-08-18 at 13:52

    Take my word for it.

  7. 2016-08-18 at 21:31

    Up yours!

  8. 2016-08-19 at 10:23

    If he shows up, we stick with him.

  9. hx
    2016-12-13 at 16:58

    you are very good

U4NBA进行回复 取消回复

邮箱地址不会被公开。