git从本地仓库上传到GitHub

选中项目右键调出Git Bash here,

1、先检查和远程仓库的链接状态ssh -T [email protected]             

Hi SledgeWang! You've successfully authenticated, but GitHub does not provide shell access.
 

2、设置用户名和邮箱

 git config --global user.name "56******[email protected]"

git config --global user.email "56******[email protected]"


3、添加远程地址

 git remote add origin https://github.com/SledgeWang/heque.git

但是报错了:fatal: not a git repository (or any of the parent directories): .git ===>初始化 git init
执行刚才的远程地址添加

4、添加和提交

git add .

git commit -m "2018/08/24 11:57:00"

5、push

git push,会弹出GitHub用户登录

猜你喜欢

转载自blog.csdn.net/wang20y8/article/details/82015368