1. 程式人生 > >idea提交專案到github相關錯誤

idea提交專案到github相關錯誤

在使用idea,想把專案上傳到遠端github的時候,

出現的錯誤

Can’t finish GitHub sharing process
Successfully created project ‘springboot’ on GitHub, but initial commit failed:
*** 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: empty ident name (for <(null)>) not allowed
during executing git -c core.quotepath=false commit -m “Initial commit” –
1、在Idea中,File-Settings-Version Control-git 中,設定git安裝目錄
在這裡插入圖片描述

2、新增GitHub賬號,File-Settings-Version Control-GitHub,
在這裡插入圖片描述

新增賬號密碼,點選test,成功。

3、點選cvs-import into version control-share project on github
在這裡插入圖片描述

結果保錯:

Can’t finish GitHub sharing process
Successfully created project ‘springboot’ on GitHub, but initial commit failed:
*** 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: empty ident name (for <(null)>) not allowed
during executing git -c core.quotepath=false commit -m “Initial commit” –
.
開啟GitHub,檢視自己專案發現只建立了一個空的倉庫,點選倉庫名,進入倉庫,

點選setting,拖動到最下面,點選delete this repository,輸入倉庫名稱,點刪除。

4、開啟git安裝目錄,找到git bash,雙擊執行,執行命令

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

git config --global user.name “Your Name”
上面的方法配置的是全域性的使用者名稱和郵箱!就是說如果沒有單獨為專案配置,那提交的所有專案全部都是這個名字和郵箱!不管是公司專案還是github,還是碼雲!

單獨為專案配置的方法(全域性和單獨配置都存在的時候會預設使用專案單獨配置的):

1.開啟專案所在目錄,找到隱藏的.git資料夾。注意這個資料夾是隱藏的,顯示隱藏出來就行。

2.開啟資料夾裡的config檔案,推薦用nodepad++開啟。

3.新增這三行到檔案:

[user]
name = XXX(自己的名稱)
email = XXXX(郵箱)
當然也可以通過命令列的方式,只需要在 .git 資料夾下。 例如執行如下命令:

git config user.name “xxxxx”