Skip to content

Commit e433705

Browse files
author
Junio C Hamano
committed
Documentation: git-apply --no-add
This is a specialized hack to help no-base merges, but other people might find it useful, so let's document it. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent cb93c19 commit e433705

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Documentation/git-apply.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-apply - Apply patch on a git index file and a work tree
88

99
SYNOPSIS
1010
--------
11-
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--index-info] [-z] [<patch>...]
11+
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [-z] [<patch>...]
1212

1313
DESCRIPTION
1414
-----------
@@ -72,6 +72,12 @@ OPTIONS
7272
patch. Give this flag after those flags to also apply
7373
the patch.
7474

75+
--no-add::
76+
When applying a patch, ignore additions made by the
77+
patch. This can be used to extract common part between
78+
two files by first running `diff` on them and applying
79+
the result with this option, which would apply the
80+
deletion part but not addition part.
7581

7682
Author
7783
------

apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static int no_add = 0;
2727
static int show_index_info = 0;
2828
static int line_termination = '\n';
2929
static const char apply_usage[] =
30-
"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--index-info] [-z] <patch>...";
30+
"git-apply [--stat] [--numstat] [--summary] [--check] [--index] [--apply] [--no-add] [--index-info] [-z] <patch>...";
3131

3232
/*
3333
* For "diff-stat" like behaviour, we keep track of the biggest change

0 commit comments

Comments
 (0)