github配置和文件上传

来源:互联网 发布:js皮肤哪个好 编辑:程序博客网 时间:2024/05/17 22:19

$ cd ~/.ssh      #查看SSH key文件目录

bash: cd: /c/Users/Administrator/.ssh: No such file or directory

$ ssh-keygen -t rsa -C "r1nging@qq.com"           #新建SHH key文件

登陆github系统,点击右上角的Settings--->SSH and GPG keys ---> New SSH key

把C:\Users\Administrator\.ssh\ id_rsa.pub 里的代码复制上去

$ ssh -T git@github.com       #测试是否能连接github.com

$ git config --global user.name "r1nging"     #设置user和email,供commit记录

$ git config --global user.email "r1nging@qq.com"

$ git config --global github.user r1nging       #github上的用户名

登陆github系统,点击右上角的Settings--->Personal access tokens --->Generate new token

输入token的名字,然后把想勾的都勾上,点generate token。把生成的token复制到下面的命令。

$ git config --global github.token  605e12c7dce052d5e88d0baa155eaabf222d0b1e

$ mkdir ~/hello-world        #创新一个hello-world项目文件夹

$ cd ~/hello-world              #进入到hello-world文件夹

$ git init                                #更新目录

$ touch README.md

$ git add README.md

$ git commit -m 'first commit'

$ git push -u origin master         #开始上传README.md

putty:

http://jingyan.baidu.com/article/0f5fb099cdc2426d8334ea0d.html

参考:

https://help.github.com/articles/set-up-git/

git/github学习笔记

上传项目代码到github

0 0
原创粉丝点击