Android Studio 使用GitHub


Android Studio 使用GitHub

1.安裝配置

默認大家都已經安裝了git軟件,參考下圖進行git與as關聯

  • 配置git 
    配置git

  • 設置GitHub用戶信息 
    配置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上面,解決辦法如下圖,第一個是設置郵箱地址,第二個是設置用戶名
這里寫圖片描述

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM