Android Studio 使用GitHub
1.安裝配置
默認大家都已經安裝了git軟件,參考下圖進行git與as關聯
-
配置git

-
設置GitHub用戶信息

-
填寫完用戶名,密碼后可以點擊Test,出現下圖則配置成功

2.分享項目到GitHub
-
開啟GitHub插件

-
創建關聯的庫,點擊Share進行分享

-
點擊ok提交代碼

這樣我們就把本地項目已經與github關聯起來了,請看下圖。左邊的是用來更新github上面的項目的,右邊是用來提交我們本地項目的
3.注意事項
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” –
由於剛配置的環境,沒有配置會出現這樣的錯誤。大致意思是需要一個名稱才能提交到github上面,解決辦法如下圖,第一個是設置郵箱地址,第二個是設置用戶名

