如何把本地文件上传github

1.$ git config --global user.name "xxx"

2.$ git config --global user.email xxx@qq.com

3.进入想要上传的该文件夹的目录

$ git init(空文件夹不行)

4.

$ git add .

5.

$ git commit -m "java2"

java2是随便起的名字、

6.

$ git remote add origin https://github.com/liangxinjingmeng/44444.git

https://github.com/liangxinjingmeng/44444.git为github上的地址

7.

$ git push -u origin master

执行这一步一开始可能会出错:

 ! [rejected]        master -> master (fetch first)

error: failed to push some refs to 'https://github.com/liangxinjingmeng/44444.git'

出错之后执行8,9

8.

$ git pull --rebase origin master

9.

$ git push -u origin master

 

posted @ 2019-11-12 12:15  凉心、惊梦  阅读(174)  评论(0编辑  收藏  举报