1. 设置git
首先找到IDE的File->Settings:
然后在设置git路径
2.设置github
登录时注意不要使用邮箱,本人在这里尝试登录了很多次才登录进去,但是在网页中登录一直正常的,期间还尝试了使用token登录也失败了,关于token,可以在github账号下生成,最后重启网络,偶然间又登录进去了,真是莫名其妙。
3.上传项目
- 导入当前项目
- 创建github项目仓库
- 添加需要上传的文件,并填写提交的信息
提交时报了错误:Can’t finish GitHub sharing process,已经成功创建了一个空项目,但初始提交失败,提示请告诉我你是谁
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'liuyu@DESKTOP-TDCU62H.(none)')
于是打开git bash here命令行程序:按照提示输入github的邮箱和名字
再次进行添加文件,注意要添加变更的信息:
提交到github:
正式上传:
4.更改本地文件并提交
提交并编辑变更信息
推送至github,最终成功
5.从GitHub上更新到本地