> For the complete documentation index, see [llms.txt](https://cmmobile.gitbook.io/cmmobilebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cmmobile.gitbook.io/cmmobilebook/git-zhu-ti/git-shi-yong-fang-fa.md).

# Git 使用方法

## 如何使用Git?

* 第一點: 分支的概念
  * master: 程式碼紀錄的主幹
  * branch: 當要開發新功能或是緊急修復，會開一個分支進行開發
  * merge: 新功能或是緊急修復完成後，需要合併回主幹，讓主幹也有新功能

![分支的概念](/files/-M9wjx50a4bvA8VMYkB7)

* 第二點: 程式碼的操作
  * clone: 下載整份Repo到本機
  * add: 加入更動到暫存區
  * commit: 記錄在本機
  * push: 推送到遠端
  * pull: 拉取遠端的紀錄
  * checkout: 切換分支
  * merge: 合併分支

![程式碼的操作](/files/-M9wjx4zExNpyA1oi1_R)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cmmobile.gitbook.io/cmmobilebook/git-zhu-ti/git-shi-yong-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
