Skip to content

Commit d7a5396

Browse files
committed
Add notes on merge conflicts
1 parent bc64650 commit d7a5396

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

content/git/merge.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
title="Merge"
33
date = 2023-04-17
4-
updated = 2025-04-26
4+
updated = 2026-04-23
55
extra = { series = "Git" }
66
taxonomies = { tags = ["Git"] }
77
+++
@@ -13,3 +13,26 @@ It is sometimes possible to abort a merge for example if there is a conflict and
1313
```sh
1414
git merge --abort
1515
```
16+
17+
# Merge conflicts
18+
19+
Source: <https://stackoverflow.com/questions/10697463/resolve-git-merge-conflicts-in-favor-of-their-changes-during-a-pull>
20+
21+
## Taking all of one side
22+
23+
**WARNING: This literally just takes all of one side it's not selective**.
24+
25+
If you are already in the merging state and have conflicts and want to take all of ours or theirs you can use one of following.
26+
If you are unclear what `theirs` and `ours` refers to it's best to consult [the docs](https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt---theirs) and note it matters if you are rebasing (but this section I'm talking about merging).
27+
28+
```sh
29+
git checkout --theirs .
30+
```
31+
32+
If you want to do the opposite:
33+
34+
```sh
35+
git checkout --ours .
36+
```
37+
38+
You can mark all the conflicts resolved after by using `git add .` or `git add -u` to only stage tracked files.

0 commit comments

Comments
 (0)