---
title: "取得目前的 git branch 名稱"
description: "取得目前的 git branch 名稱"
canonical: https://oozou.com/til/get-current-git-branch-name-43
locale: zh-Hant
date: 2020-10-13
topic: shell
---

# 取得目前的 git branch 名稱

> 取得目前的 git branch 名稱

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hant/til-topics/shell) ([markdown](https://oozou.com/zh-Hant/til-topics/shell.md))

```shell
git rev-parse --abbrev-ref HEAD
```

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hant/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
