Add 'ours' merge strategy.
This adds the coolest merge strategy ever, "ours". It can take arbitrary number of foreign heads and merge them into the current branch, with the resulting tree always taken from our branch head, hence its name. What this means is that you can declare that the current branch supersedes the development histories of other branches using this merge strategy. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Nov 1, 2005 at 19:34 UTC
64da9e604eea25c9c20cfe12618285ccd0bf3cfe
4 files changed
+10
-2
.gitignore
+1
@@ -50,6 +50,7 @@ git-merge-base
50
git-merge-index
51
git-merge-octopus
52
git-merge-one-file
53
+git-merge-ours
54
git-merge-recursive
55
git-merge-resolve
56
git-merge-stupid
Makefile
+1
-1
@@ -89,7 +89,7 @@ SCRIPT_SH = \
89
git-tag.sh git-verify-tag.sh git-whatchanged.sh git.sh \
90
git-applymbox.sh git-applypatch.sh git-am.sh \
91
git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
92
- git-merge-resolve.sh git-grep.sh
92
+ git-merge-resolve.sh git-merge-ours.sh git-grep.sh
93
94
SCRIPT_PERL = \
95
git-archimport.perl git-cvsimport.perl git-relink.perl \
git-merge-ours.sh
new
+7
@@ -0,0 +1,7 @@
1
+#!/bin/sh
2
+#
3
+# Copyright (c) 2005 Junio C Hamano
4
+#
5
+# Pretend we resolved the heads, but declare our tree trumps everybody else.
6
+#
7
+exit 0
git-merge.sh
+1
-1
@@ -14,7 +14,7 @@ usage () {
14
15
# all_strategies='resolve recursive stupid octopus'
16
17
-all_strategies='recursive octopus resolve stupid'
17
+all_strategies='recursive octopus resolve stupid ours'
18
default_strategies='resolve octopus'
19
use_strategies=
20