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>
This commit is contained in:

committed by
Junio C Hamano

parent
6dc4627ef4
commit
8afa42101d
@ -13,7 +13,7 @@ SYNOPSIS
|
|||||||
[--msg-filter <command>] [--commit-filter <command>]
|
[--msg-filter <command>] [--commit-filter <command>]
|
||||||
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
|
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
|
||||||
[--original <namespace>] [-d <directory>] [-f | --force]
|
[--original <namespace>] [-d <directory>] [-f | --force]
|
||||||
[<rev-list options>...]
|
[--] [<rev-list options>...]
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
-----------
|
-----------
|
||||||
@ -168,10 +168,10 @@ to other tags will be rewritten to point to the underlying commit.
|
|||||||
'refs/original/', unless forced.
|
'refs/original/', unless forced.
|
||||||
|
|
||||||
<rev-list options>...::
|
<rev-list options>...::
|
||||||
When options are given after the new branch name, they will
|
Arguments for 'git-rev-list'. All positive refs included by
|
||||||
be passed to 'git-rev-list'. Only commits in the resulting
|
these options are rewritten. You may also specify options
|
||||||
output will be filtered, although the filtered commits can still
|
such as '--all', but you must use '--' to separate them from
|
||||||
reference parents which are outside of that set.
|
the 'git-filter-branch' options.
|
||||||
|
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
@ -196,6 +196,17 @@ git filter-branch --index-filter 'git rm --cached filename' HEAD
|
|||||||
|
|
||||||
Now, you will get the rewritten history saved in HEAD.
|
Now, you will get the rewritten history saved in HEAD.
|
||||||
|
|
||||||
|
To rewrite the repository to look as if `foodir/` had been its project
|
||||||
|
root, and discard all other history:
|
||||||
|
|
||||||
|
-------------------------------------------------------
|
||||||
|
git filter-branch --subdirectory-filter foodir -- --all
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
Thus you can, e.g., turn a library subdirectory into a repository of
|
||||||
|
its own. Note the `\--` that separates 'filter-branch' options from
|
||||||
|
revision options, and the `\--all` to rewrite all branches and tags.
|
||||||
|
|
||||||
To set a commit (which typically is at the tip of another
|
To set a commit (which typically is at the tip of another
|
||||||
history) to be the parent of the current initial commit, in
|
history) to be the parent of the current initial commit, in
|
||||||
order to paste the other history behind the current history:
|
order to paste the other history behind the current history:
|
||||||
|
Reference in New Issue
Block a user