You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,27 @@
1
1
# Create Magic Merge Commit
2
2
3
-
Ever build on a branch which meanwhile was squashed-merged into `main` and then you wanted to merge a pull request that was based on that branch? You know, the one that has a commit that conflicts with the squashed commit in `main`?
3
+
Have you ever created a branch based on another branch?
4
+
Then that other branch got [squash-merged](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github#squashing-your-merge-commits) into `main`.
5
+
Now your pull request, which was based on that branch, can’t merge cleanly because Git sees your old commit as conflicting with the squashed commit in main?
4
6
5
-
This tool creates a "magic" merge commit that resolves the conflict by connecting the two branches together, allowing you to merge without conflicts.
7
+
This tool generates a special merge commit that links your branch to the squashed history in `main`, eliminating the conflict and letting you merge `main`without trouble.
6
8
7
-
Execute is with following command:
9
+
Execute the tool with following command:
8
10
9
11
```terminal
10
12
jbang do@koppor/magic-merge-commit <pr-number>
11
13
```
12
14
13
-
For this, you need to have [jbang](https://www.jbang.dev/) installed.
15
+
## Installation
16
+
17
+
To have `jbang` working, you need to install it. Find information at the [jbang page](https://www.jbang.dev/).
14
18
15
19
If you don't want to install jbang, place [`gg.cmd`](https://github.com/eirikb/gg#ggcmd) into the root of your git repository and execute as follows:
0 commit comments