如何把本地文件上传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

 

与其战胜敌人一万次,不如战胜自己一次。
原文地址:https://www.cnblogs.com/hyjh/p/11841064.html