在git創(chuàng)建項(xiàng)目時出現(xiàn)现横,
*** 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 'GWB@GWB-PC.(none)')
是因?yàn)樵趧?chuàng)建git文件夾的時候信息不完善導(dǎo)致的
解決方法是當(dāng)出現(xiàn)這個上述提示后 接著補(bǔ)充
在命令行中執(zhí)行
git config --global user.email "你的郵箱"
git config --global user.name "你的名字"
(注意 “ 前面是有空格的)
輸入完后再接著執(zhí)行g(shù)it commit 即可成功!
正確方式為:
- 生成本地倉庫
依次敲
- git init
- git config user.name "someone"
- git config user.email "someone@someplace.com"
- git add *
- git commit -m "init msg"
創(chuàng)建遠(yuǎn)程倉庫
github上完成蜀涨,點(diǎn)擊創(chuàng)建后會生成一個后綴為.git關(guān)聯(lián)的代碼(復(fù)制)將本地倉庫推送到遠(yuǎn)程倉庫
- 關(guān)聯(lián)
.git代碼粘貼一下 - 推送
git push origin master