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 "[email protected]"
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上更新到本地