Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. 如何使用 Git
  6. 如何在 Mac 中使用 Git
  7. 提交檔案
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

提交檔案

我們將新增一個新檔案,並將其註冊在我們剛建立的儲存庫中。

使用下列文本內容在該目錄中建立一個名為sample.txt的檔案。

Anyone can learn Git with this tutorial and Backlog

在 Sourcetree 的書籤窗口中雙擊tutorial儲存庫,來彈出儲存庫操作視窗。如果目錄中有任何剛才新增或編輯的檔案,將顯示在工作目錄檔案檢查工具的左下角。

因為我們剛才將sample.txt檔案新增到tutorial目錄中,所以我們看到它列在那裡。

Repository screen

右鍵單擊「sample.txt」檔案,並選取「Add to Index」。該檔案將移動到上面的「Files staged in the index」清單中。

Click Add to Index

單擊工具列上的「Commit」圖示,輸入提交訊息 (例如,「first commit」),然後單擊「Commit」。

Enter commit message and click commit button

完成後,您將在「main」分支歷史紀錄中找到提交。您可以透過單擊左側選單中的「History」來驗證提交是否成功。

The commit is added

接下來,您已準備好與您的團隊共享儲存庫。

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life