没有不值得去解决的问题,也没有不值得去学习的技术!

How to Use git cherry-pick in TortoiseGit

Select the commit ID to cherry-pick from branch A

1. Reference: Using git cherry-pick in the command line.

2. Reference: https://tortoisegit.org/docs/tortoisegit/tgit-dug-cherrypick.html .

3. Switch to branch B to cherry-pick commits from branch A to branch B. Show log. As shown in Figure 1.

Switch to branch B to cherry-pick commits from branch A to branch B. Show log
Figure 1

 

4. Click branch B to select branch A. As shown in Figure 2.

Click branch B to select branch A
Figure 2

5. Select branch A. You will subsequently select a commit ID from this branch to cherry-pick to branch B. The current branch remains branch B. As shown in Figure 3.

Select branch A. You will subsequently select a commit ID from this branch to cherry-pick to branch B. The current branch remains branch B
Figure 3

6. Select the commit ID to cherry-pick from branch A. As shown in Figure 4.

Select the commit ID to cherry-pick from branch A
Figure 4

7. Select all and click Continue. As shown in Figure 5.

Select all and click Continue
Figure 5

8. Conflicts occur during the process, as shown in Figure 6.

Conflicts occur during the process
Figure 6

9. Right-click the conflicted file and resolve the conflict using the commit ID. Confirm marking the conflicted file as resolved? Yes. As shown in Figure 7.

Right-click the conflicted file and resolve the conflict using the commit ID. Confirm marking the conflicted file as resolved? Yes
Figure 7

10. Click Commit, as shown in Figure 8.

Click Commit
Figure 8

11. Select Ignore, as shown in Figure 9.

Select Ignore
Figure 9

12. The current commit will be empty (for example, due to conflict resolution). Skip this commit or keep only the commit message? Skip. As shown in Figure 10.

The current commit will be empty (for example, due to conflict resolution). Skip this commit or keep only the commit message? Skip
Figure 10

13. During conflicts, some conflicted files may require manual resolution, as step 9 does not apply to all conflicted files. For example, a conflicted file might already contain code implementations from other commit IDs. As shown in Figures 11 and 12.

During conflicts, some conflicted files may require manual resolution, as step 9 does not apply to all conflicted files.
Figure 11

 

For example, a conflicted file might already contain code implementations from other commit IDs.
Figure 12

14. After manually resolving the conflict, right-click to resolve and commit. As shown in Figure 13.

After manually resolving the conflict, right-click to resolve and commit
Figure 13

15. This is a merge commit. Which parent node do you want to pick? As shown in Figure 14.

This is a merge commit. Which parent node do you want to pick?
Figure 14

16. You should select parent node 1: When installing the theme, the configuration items are stored in the database based on the theme’s ignore settings. As shown in Figure 15.

You should select parent node 1: When installing the theme, the configuration items are stored in the database based on the theme's ignore settings.
Figure 15

17. Force push to the server.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系