> For the complete documentation index, see [llms.txt](https://alanmpan.gitbook.io/git-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alanmpan.gitbook.io/git-learning/git/26.-he-bing-dao-zhu-fen-zhi.md).

# 26.合并到主分支

```powershell
git checkout master
Switched to branch 'master'

git merge lgnew
Updating 1c78eab..2456c71
Fast-forward
lab/test2.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 lab/test2.txt

git hist
* 2456c71 2023-05-05 | Added teset2.txt (HEAD -> master, lgnew) [aku]
* 1c78eab 2023-05-05 | Added teset3.txt [aku]
* 31e5621 2023-05-05 | Added teset2.txt [aku]
* 5dc8b1e 2023-05-05 | Added .gitignore [aku]
* b77158a 2023-05-05 | Moved test.txt to lab [aku]
* 929f644 2023-05-05 | Added 123456 to the test.txt [aku]
* d7f681f 2023-05-05 | Added abc to the test.txt (tag: v1) [aku]
* 01b8702 2023-05-05 | Add first file (tag: v1-beta) [aku]
```

从日志的输出结果来看，对于本地代码迭代，我们最好在新分支上操作，这样可以降低影响主分支，并且保持主分支的提交干净整洁。


---

# 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, and the optional `goal` query parameter:

```
GET https://alanmpan.gitbook.io/git-learning/git/26.-he-bing-dao-zhu-fen-zhi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
