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.

建立本地儲存庫

現在,讓我們建立一個本地儲存庫並將其置於 Git 版本控制之下,以便我們可以在本教程的其餘部分中使用它。

如果到目前為止您已經按照安裝教程進行操作,請返回 Sourcetree 應用程序視窗,否則透過啟動應用程序將其開啟。然後單擊書籤清單視窗左上方的「New…」。或者,您可以從選單列中選取 File > New。

Start SourceTree

選取「Create Local Repository」。

Select Create Local Repository

輸入目標目錄名稱tutorial以建立本地儲存庫。如果該目錄尚不存在,Sourcetree 將為您創建它。

確保儲存庫的路徑是您想要的。Sourcetree 可能會選擇您的家目錄作為預設目錄。請注意不要在您的家目錄中初始化 Git 儲存庫;否則,Sourcetree 完成指示之前可能需要一段時間,然後儲存庫將顯示為不是空白。如果「Destination Path」欄位設定為您的家目錄,請確保在末尾附加/tutorial以指示 Sourcetree 在那裡創建一個新的空目錄。最後,單擊「Create」按鈕。

Enter the target directory name and click the Create button

新儲存庫現在將位於書籤清單中。

SourceTree Bookmark list

現在您已準備好將檔案提交到儲存庫。

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life