新增Git操作文档
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2025-12-26 21:01:44 +08:00
parent 09a4112b40
commit ce98d5e641
4 changed files with 138 additions and 3 deletions

View File

@@ -0,0 +1,46 @@
> 本文作者:丁辉
# GIt跨分支合并某个提交记录
## 跨分支合并某个提交记录
> 例子:假如我有 A 、B 分支
1. 切换到 A 分支
```bash
git checkout <A分支>
```
2. 查看提交日志拿到值
```bash
git log
```
3. 切换到 B 分支
```bash
git checkout <B分支>
```
4. 合并
```bash
git cherry-pick '获取到的提交记录值'
```
5. 检查提交记录,查看是否将 A 文件合并到了 B 仓库
```bash
git log
```
6. 提交文件
```bash
git add .
git push
```