如何将本地代码上传到github上

在github上创建项目

在这里插入图片描述
repository创建成功
在这里插入图片描述

把本地代码提交到git

进入存放要提交代码的本地目录,右键“git bash here”
在这里插入图片描述
git init
在这里插入图片描述
设置用户
git config --global user.name “XXX”
git config --global user.email “XXX”
在这里插入图片描述
git init
git add .
git commit -m “XXX”
git remote add origin 项目地址
git push -u origin master
在这里插入图片描述
提交成功,在github上刷新一下,本地的文件已经上传到github上了
在这里插入图片描述

发布了90 篇原创文章 · 获赞 8 · 访问量 8248

猜你喜欢

转载自blog.csdn.net/weixin_43854189/article/details/102813522