Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. 如何使用 Git
  6. 如何在 Git 中使用標籤
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

如何在 Git 中使用標籤

在本教程中,您已經學會了如何在 Windows, MacCommand Line 中使用 Git,以及 使用分支 工作。現在我們將討論標籤。

如果您錯過了我們對標籤的介紹,您可以在此處重新溫習該內容

首先,讓我們設定一些東西。創建一個名為tutorial的新目錄,並使用 git init 指令初始化一個 Git 儲存庫。

$ mkdir tutorial
$ cd tutorial
$ git init
Initialized empty Git repository in /Users/username/Desktop/tutorial/.git/

然後在tutorial目錄中建立一個名為myfile.txt的新檔案,內容如下,並將它提交。

Anyone can learn Git with this tutorial and Backlog
$ git add myfile.txt
$ git commit -m "first commit"
[main (root-commit) a73ae49] first commit
1 files changed, 1 insertions(+), 0 deletions(-)
  create mode 100644 myfile.txt

此時,歷史紀錄看起來是這樣的:

Current history

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life