1. 程式人生 > >解決上傳到github報錯Successfully created project 'autotest' on GitHub, but initial commit failed:

解決上傳到github報錯Successfully created project 'autotest' on GitHub, but initial commit failed:

.com auto efault oba core ted config use body

通過IDEA上傳代碼到GitHub上可是有時候會碰到這樣的問題。

當我們選擇VCS->Import into Version Control->Share Project on GitHub提交代碼。點擊OK。然後就跳出了這樣的信息:

Can‘t finish GitHub sharing process

Successfully created project ‘autotest‘ 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" --

看了一下錯誤原因:Run git config --global user.email "[email protected]" git config --global user.name "

原來是github沒有配置的原因,解決辦法如下。
1. 在你安裝Git的目錄下找到git-bash這個可執行文件
2. 設置用戶名和郵箱地址,如下圖:

$ git config --global user.name "your name"
$ git config --global user.email "[email protected]"

解決上傳到github報錯Successfully created project 'autotest' on GitHub, but initial commit failed: