Documentation: filter-branch: document how to filter all refs
Document the '--' option that can be used to pass rev-list options (not just arguments), and give an example usage of '-- --all'. Remove reference to "the new branch name"; filter-branch takes arbitrary arguments to rev-list since dfd05e3. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Aug 7, 2008 at 16:16 UTC
8afa42101d14f8944c1eb7f2e54d4f5300d2bb73
1 file changed
+16
-5
Documentation/git-filter-branch.txt
+16
-5
@@ -13,7 +13,7 @@ SYNOPSIS
13
[--msg-filter <command>] [--commit-filter <command>]
14
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
15
[--original <namespace>] [-d <directory>] [-f | --force]
16
- [<rev-list options>...]
16
+ [--] [<rev-list options>...]
17
18
DESCRIPTION
19
-----------
@@ -168,10 +168,10 @@ to other tags will be rewritten to point to the underlying commit.
168
'refs/original/', unless forced.
169
170
<rev-list options>...::
171
- When options are given after the new branch name, they will
172
- be passed to 'git-rev-list'. Only commits in the resulting
173
- output will be filtered, although the filtered commits can still
174
- reference parents which are outside of that set.
171
+ Arguments for 'git-rev-list'. All positive refs included by
172
+ these options are rewritten. You may also specify options
173
+ such as '--all', but you must use '--' to separate them from
174
+ the 'git-filter-branch' options.
175
176
177
Examples
@@ -196,6 +196,17 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD
196
197
Now, you will get the rewritten history saved in HEAD.
198
199
+To rewrite the repository to look as if `foodir/` had been its project
200
+root, and discard all other history:
201
+
202
+-------------------------------------------------------
203
+git filter-branch --subdirectory-filter foodir -- --all
204
+-------------------------------------------------------
205
+
206
+Thus you can, e.g., turn a library subdirectory into a repository of
207
+its own. Note the `\--` that separates 'filter-branch' options from
208
+revision options, and the `\--all` to rewrite all branches and tags.
209
+
210
To set a commit (which typically is at the tip of another
211
history) to be the parent of the current initial commit, in
212
order to paste the other history behind the current history: