summarylogtreecommitdiffstats
path: root/merge-upstream
blob: 71a972d355a629f627952d70966a1d65157df640 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Merges changes from the upstream without the undesired commits.

set -e

export GIT_EDITOR=true

git switch \
	--detach \
	upstream/main

git rebase \
	--onto 2b1f7cc9ea70119109e9ffd559c27b449ff83546{^,} ||
	true

# Files added by the undesired commits.
rm -fr \
	LICENSE \
	LICENSES \
	REUSE.toml

git add -A

git rebase --continue || true

git rebase main

git branch \
	--force \
	main \
	HEAD

git switch main