第一步,下載git客戶端,並且安裝
下載地址:https://git-for-windows.github.io/
第二步,在android studio中配置git(注意第一張圖中的C:\Program Files\Git\bin\git.exe 是我的git安裝后的bin目錄)以及github賬戶(若沒有,需要提前到github上注冊)


點擊test,會彈出successful!
第三步,上傳項目

第一次上傳的時候提示如右上角,顯示已創建庫,但是代碼沒有上傳。
Can’t finish GitHub sharing process Successfully created project ‘GitHubDemo’ on GitHub, but initial commit failed: * 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: empty ident name (for ) not allowed during executing git -c core.quotepath=false commit -m “Initial commit xxx” –
我的解決辦法:
再次重復第三步驟就可以了,會彈出輸入hgithub的賬號密碼界面,然后就成功了。也可以在github上看到。
網上有個其他的解決辦法:http://blog.csdn.net/baidu_17313961/article/details/52068846
