發表於 程式分享

Android Studio 新增 版控 github (Mac OS)

1.安裝git
https://git-scm.com/download/mac

2.申請github
https://github.com/

3.申請github ssh key
1) cd /Users/grace/StudioProjects
2) ls ~/.ssh => 若存在,請確認是否可覆蓋
3) ssh-keygen -t rsa (請自行看是否設定密碼) => 產生了id_rsa.pub

4.設定ssh key至git hub上
1) 於github建立Repositories,Ex.Android
2) 至github右上角的Settings -> SSH &GPG keys -> SSH keys
-> Click “New SSH Key" Button -> 貼上id_rsa.pub內文

5.設定android studio使用git版控
1) VCS -> Import into version Control -> Create Git Repositories
-> 設定/Users/grace/StudioProjects
2) Android View -> Project View
3) Control + V -> Commit
4) Control + V -> Push
5) origin設定為git@github.com:[github user]/Android.git

發表留言