iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 3
1
Mobile Development

Andriod Studio 菜鳥的學習分享系列 第 3

[Android Studio菜鳥的學習分享]GitHub創造屬於你孩子們的家(下)-專案上傳備份

昨天我們把環境安裝完成,
今日要將專案上傳備份。
前半段為第一次上傳,
後半段有兩種方式為之後每次備份。


第一次上傳

Step01:

選取版控Git
https://ithelp.ithome.com.tw/upload/images/20200831/20129524ird0qod74a.jpg

https://ithelp.ithome.com.tw/upload/images/20200831/20129524UKdrX0NoFn.jpg

這時專案內檔案會呈現紅色
代表目前檔案並未上傳至GitHub
https://ithelp.ithome.com.tw/upload/images/20200831/201295242FGPm0EqN1.jpg

Step02:

選擇 VCS -> Import into Version Control -> Share Project On GitHub
https://ithelp.ithome.com.tw/upload/images/20200831/20129524XgSzTeuC0O.jpg

Step03:

Repository name:專案名稱
Description:專案描述
Private:是否為私人專案(要不要給別人看)
https://ithelp.ithome.com.tw/upload/images/20200831/20129524HExVB458j0.jpg

Step04:

Commit Message:這次更新的描述
上面檔案為這次的變更
https://ithelp.ithome.com.tw/upload/images/20200831/20129524J5oE2H2xww.jpg

這時專案內檔案會呈現白色
代表目前檔案已上傳至GitHub
https://ithelp.ithome.com.tw/upload/images/20200831/20129524cPL1gw34CL.jpg

可以至GitHub網站查看專案
https://ithelp.ithome.com.tw/upload/images/20200831/20129524MrgRjomR0l.jpg


每日備份方式(1)圖形化介面

Step01:

當每日專案告一段落準備備份,
有更動過或是新增的檔案會呈現藍色。
https://ithelp.ithome.com.tw/upload/images/20200831/20129524Vd60Rhrpwe.jpg

Step02:

點選 VCS -> Commit
https://ithelp.ithome.com.tw/upload/images/20200831/20129524rPsg95l9dc.jpg

Step03:

這邊會顯示你的檔案更動的程式碼段落,
Commit Message請輸入本次的更新描述,
輸入後請按Commit
https://ithelp.ithome.com.tw/upload/images/20200831/20129524JmhZKQeQKZ.jpg

Step04:

點選 VCS -> Git -> Push
https://ithelp.ithome.com.tw/upload/images/20200831/20129524WwFZvZWaAE.jpg

Step05:

請確認有剛剛的Commit更新描述,
按下Push
https://ithelp.ithome.com.tw/upload/images/20200831/201295247JYqKXU9PA.jpg

Step06:

這時專案內檔案會呈現白色
代表目前檔案已上傳至GitHub
右下角會有成功的提示
https://ithelp.ithome.com.tw/upload/images/20200831/20129524ATDHRbxqGK.jpg

可以至GitHub網站查看專案
有更動的資料夾描述會更改為最新的描述,
更新時間也看的到
https://ithelp.ithome.com.tw/upload/images/20200831/20129524IzZZEaYouz.jpg


每日備份方式(2)指令輸入

Step01:

開啟Terminal
https://ithelp.ithome.com.tw/upload/images/20200831/20129524JVXb5SpEIA.jpg

Step02:

使用git add.將新更或新增的檔案加入git版控

git add .

https://ithelp.ithome.com.tw/upload/images/20200831/201295248pSv3P6zke.jpg

Step03:

新增更新節點

git commit -m "這次的更新描述"

https://ithelp.ithome.com.tw/upload/images/20200831/20129524kHJofVAall.jpg

Step04:

確認Commit成功(可使用方式(1)Step05確認),
使用git push更新至GitHub

git push

https://ithelp.ithome.com.tw/upload/images/20200831/20129524cvMmSrmgLJ.jpg

Step05:

第一次使用請登入GitHub帳號
https://ithelp.ithome.com.tw/upload/images/20200831/20129524GK03WRpo4z.jpg

Step06:

完成
https://ithelp.ithome.com.tw/upload/images/20200831/20129524du6ZjKQRIL.jpg


建議先使用方法(1),
等熟悉後再使用方法(2)!
每天都有備份的話,
GitHub網站還能看到你的更新量
把它填滿是不是很有成就感呀~
https://ithelp.ithome.com.tw/upload/images/20200831/201295241WjVX3rLzb.jpg


上一篇
[Android Studio菜鳥的學習分享]GitHub創造屬於你孩子們的家(上)-環境安裝
下一篇
[Android Studio菜鳥的學習分享]使用你的手機測試APP-有線USB
系列文
Andriod Studio 菜鳥的學習分享30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言