diff --git a/README.md b/README.md index 8554b9b..4810bf5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Upload Old Project +# Tutorial_Git-UploadOldProject 此專案示範如何將手邊上傳至 Gitea @@ -34,7 +34,7 @@ 3. 登打儲存庫資料 - 填寫儲存庫名稱(專案名稱),擁有者須為 `OAD-WebTeam` ,瀏覽權限設定為 `Private 私有`,相關資料填妥後建立儲存庫。 + 填寫儲存庫名稱(專案名稱),擁有者須為 `OAD-WebTeam(組織)` ,瀏覽權限設定為 `Private 私有`,相關資料填妥後建立儲存庫。 ![新增儲存庫](doc_image/2023-10-20-10-31-38.png) @@ -58,7 +58,69 @@ ### 上傳 Source Code -專案將依照 [GitFlow](https://gitbook.tw/chapters/gitflow/why-need-git-flow) 原則進行版控,操作方式以 [使用 command line git 指令操作](#使用-command-line-git-指令操作) 或 [使用 SourceTree 介面操作](#使用-sourcetree-介面操作) 兩種方式擇一即可。 +專案將依照 [GitFlow](https://gitbook.tw/chapters/gitflow/why-need-git-flow) 原則進行版控,操作方式以 [使用 SourceTree 介面操作](#使用-sourcetree-介面操作) 或 [使用 command line git 指令操作](#使用-command-line-git-指令操作) 兩種方式擇一即可。 + +#### 使用 SourceTree 介面操作 + +1. 開啟 `SourceTree` ,至 `Create` 頁籤,填入程式相關路徑及專案名稱後,新增即可。 + + ![Create](doc_image/2023-10-20-11-30-23.png) + + 若有跳出提示表示資料夾已存在,點擊 Yes 繼續即可。 + + ![CreateAlert](doc_image/2023-10-24-14-33-01.png) + + 執行完成後會產生 `.git` folder + + ![.git folder](doc_image/2023-10-24-14-08-33.png) + +2. 新增 Remote: + + ![Remote](doc_image/2023-10-20-11-35-47.png) + + ![configuration](doc_image/2023-10-20-11-36-40.png) + +3. 設定 Remote 資訊,Remote name 勾選 `Default remote` ,登打 Gitea Repository 路徑及登入帳號。 + + ![Remote](doc_image/2023-10-24-14-38-12.png) + + ![Remote info](doc_image/2023-10-24-14-37-17.png) + +4. 設定 statged files + + ![add](doc_image/2023-10-24-14-58-05.png) + + ![add done](doc_image/2023-10-24-14-59-21.png) + +5. 登打 commit message + + 在文字框內登打 `Initial commit` 後,點擊 `commit` 按鈕。 + + ![Initial commit](doc_image/2023-10-24-15-14-33.png) + +6. 切換至左方 `BRANCHS` 底下 `master` 分支,我們會看到剛剛增加的 commit,並點擊該項目可於下方查看異動項目清單。這時我們點擊右上角 `Git-flow` 按鈕設定未來上版規則。 + + ![Setting Git-flow](doc_image/2023-10-24-15-27-43.png) + +7. 使用預設即可,按 OK。 + + ![OK](doc_image/2023-10-24-15-21-37.png) + +8. 完成建立 Git-flow 規則 + + ![Git-flow](doc_image/2023-10-24-15-30-33.png) + +9. 這時我們可以注意到 `BRANCHES` 有兩個分別為 **develop** 及 **master**,但 `REMOTES` 的 origin 並無任何 Branch,我們接著按 Push 至 Remote。 + + ![Push](doc_image/2023-10-24-15-53-41.png) + +10. 因 Remote 未建立 **develop** 及 **master** Branch,故我們要將這兩個 Branch 從 Local 發布至 Remote,選擇 `Select All` 後點擊 `Push`。 + + ![Select All](doc_image/2023-10-24-15-58-16.png) + +11. 完成後我們會看到 Git Graph 上同時會出現 Remote 與 Local 的 Branch,在左側 REMOTES 也出現剛上傳的 Branch。 + + ![Success](doc_image/2023-10-24-16-01-13.png) #### 使用 command line git 指令操作 @@ -127,68 +189,6 @@ ![git push develop](doc_image/2023-10-24-15-47-33.png) -#### 使用 SourceTree 介面操作 - -1. 開啟 `SourceTree` ,至 `Create` 頁籤,填入程式相關路徑及專案名稱後,新增即可。 - - ![Create](doc_image/2023-10-20-11-30-23.png) - - 若有跳出提示表示資料夾已存在,點擊 Yes 繼續即可。 - - ![CreateAlert](doc_image/2023-10-24-14-33-01.png) - - 執行完成後會產生 `.git` folder - - ![.git folder](doc_image/2023-10-24-14-08-33.png) - -2. 新增 Remote: - - ![Remote](doc_image/2023-10-20-11-35-47.png) - - ![configuration](doc_image/2023-10-20-11-36-40.png) - -3. 設定 Remote 資訊,Remote name 勾選 `Default remote` ,登打 Gitea Repository 路徑及登入帳號。 - - ![Remote](doc_image/2023-10-24-14-38-12.png) - - ![Remote info](doc_image/2023-10-24-14-37-17.png) - -4. 設定 statged files - - ![add](doc_image/2023-10-24-14-58-05.png) - - ![add done](doc_image/2023-10-24-14-59-21.png) - -5. 登打 commit message - - 在文字框內登打 `Initial commit` 後,點擊 `commit` 按鈕。 - - ![Initial commit](doc_image/2023-10-24-15-14-33.png) - -6. 切換至左方 `BRANCHS` 底下 `master` 分支,我們會看到剛剛增加的 commit,並點擊該項目可於下方查看異動項目清單。這時我們點擊右上角 `Git-flow` 按鈕設定未來上版規則。 - - ![Setting Git-flow](doc_image/2023-10-24-15-27-43.png) - -7. 使用預設即可,按 OK。 - - ![OK](doc_image/2023-10-24-15-21-37.png) - -8. 完成建立 Git-flow 規則 - - ![Git-flow](doc_image/2023-10-24-15-30-33.png) - -9. 這時我們可以注意到 `BRANCHES` 有兩個分別為 **develop** 及 **master**,但 `REMOTES` 的 origin 並無任何 Branch,我們接著按 Push 至 Remote。 - - ![Push](doc_image/2023-10-24-15-53-41.png) - -10. 因 Remote 未建立 **develop** 及 **master** Branch,故我們要將這兩個 Branch 從 Local 發布至 Remote,選擇 `Select All` 後點擊 `Push`。 - - ![Select All](doc_image/2023-10-24-15-58-16.png) - -11. 完成後我們會看到 Git Graph 上同時會出現 Remote 與 Local 的 Branch,在左側 REMOTES 也出現剛上傳的 Branch。 - - ![Success](doc_image/2023-10-24-16-01-13.png) - ### Gitea 驗證是否上傳成功 - Repository