From bb0f404400efdcb2661c4e23e54c335fd41d2031 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 4 Jul 2007 06:41:40 +0000 Subject: [PATCH] Autogenerated HTML docs for v1.5.3-rc0-11-ge2b1a --- RelNotes-1.5.3.txt | 61 +++- cmds-ancillarymanipulators.txt | 3 + diff-options.txt | 8 + git-diff-files.html | 20 +- git-diff-index.html | 20 +- git-diff-tree.html | 20 +- git-diff.html | 20 +- git-filter-branch.html | 559 +++++++++++++++++++++++++++++++++ git-filter-branch.txt | 262 +++++++++++++++ git-format-patch.html | 28 +- git-format-patch.txt | 3 + git-fsck.html | 6 +- git-fsck.txt | 4 +- git.html | 10 +- glossary.html | 13 +- glossary.txt | 6 + user-manual.html | 7 + 17 files changed, 1023 insertions(+), 27 deletions(-) create mode 100644 git-filter-branch.html create mode 100644 git-filter-branch.txt diff --git a/RelNotes-1.5.3.txt b/RelNotes-1.5.3.txt index ef2f95b3c..e2e809e3c 100644 --- a/RelNotes-1.5.3.txt +++ b/RelNotes-1.5.3.txt @@ -4,14 +4,16 @@ GIT v1.5.3 Release Notes Updates since v1.5.2 -------------------- -* An initial interation of Porcelain level superproject support - started to take shape. +* The commit walkers other than http are officially deprecated, + but still supported for now. -* Thee are a handful pack-objects changes to help you cope better with - repositories with pathologically large blobs in them. +* The submodule support has Porcelain layer. + +* There are a handful pack-objects changes to help you cope better + with repositories with pathologically large blobs in them. * For people who need to import from Perforce, a front-end for - fast-import is in contrib/fast-import/ now. + fast-import is in contrib/fast-import/. * Comes with git-gui 0.8.0. @@ -19,10 +21,25 @@ Updates since v1.5.2 * New commands and options. - - "git log" learned a new option '--follow', to follow + - "git stash" allows you to quickly save away your work in + progress and replay it later on an updated state. + + - "git rebase" learned an "interactive" mode that let you + pick and reorder which commits to rebuild. + + - "git fsck" can save its findings in $GIT_DIR/lost-found, + without a separate invocation of "git lost-found" command. + + - $GIT_WORK_TREE environment variable can be used together with + $GIT_DIR to work in a subdirectory of a working tree that is + not located at "$GIT_DIR/..". + + - "git log" learned a new option "--follow", to follow renaming history of a single file. - - "git-filter-branch" is a reborn cg-admin-rewritehist. + - "git-filter-branch" lets you rewrite the revision history of + the current branch, creating a new branch. You can specify a + number of filters to modify the commits, files and trees. - "git-cvsserver" learned new options (--base-path, --export-all, --strict-paths) inspired by git-daemon. @@ -58,11 +75,15 @@ Updates since v1.5.2 - "git format-patch" learned --numbered-files option. This may be useful for MH users. + - "git format-patch" learned format.subjectprefix configuration + variable, which serves the same purpose as "--subject-prefix" + option. + - "git tag -n -l" shows tag annotations while listing tags. - "git cvsimport" can optionally use the separate-remote layout. - - "git blame" can be told to see through commits that changes + - "git blame" can be told to see through commits that change whitespaces and indentation levels with "-w" option. - "git send-email" can be told not to thread the messages when @@ -71,8 +92,18 @@ Updates since v1.5.2 - "git config" learned NUL terminated output format via -z to help scripts. + - "git init -q" makes the command quieter. + * Updated behavior of existing commands. + - "git svn dcommit" retains local merge information. + + - "git config" to set values also honors type flags like --bool + and --int. + + - core.quotepath configuration can be used to make textual git + output to emit most of the characters in the path literally. + - "git mergetool" chooses its backend more wisely, taking notice of its environment such as use of X, Gnome/KDE, etc. @@ -84,7 +115,7 @@ Updates since v1.5.2 $path/$project/.git are more useful. We use $project part in the filename, which we used to discard. - - "git cvsimort" creates lightweight tag; there is not any + - "git cvsimport" creates lightweight tags; there is no interesting information we can record in an annotated tag, and the handcrafted ones the old code created was not properly formed anyway. @@ -99,9 +130,9 @@ Updates since v1.5.2 - "git-apply --whitespace=strip" removes blank lines added at the end of the file. - - "git-fetch" over git native protocols with -v shows connection - status, and the IP address of the other end, to help - diagnosing problems. + - "git-fetch" over git native protocols with "-v" option shows + connection status, and the IP address of the other end, to + help diagnosing problems. - We used to have core.legacyheaders configuration, when set to false, allowed git to write loose objects in a format @@ -124,8 +155,8 @@ Updates since v1.5.2 .gitattributes. It does not attempt to deltify blobs that come from paths with delta attribute set to false. - - new-workdir script (in contrib) can now be used with a bare - repository. + - "new-workdir" script (in contrib) can now be used with a + bare repository. - "git-mergetool" learned to use gvimdiff. @@ -179,6 +210,6 @@ this release, unless otherwise noted. -- exec >/var/tmp/1 -O=v1.5.2.2-603-g7c85173 +O=v1.5.3-rc0 echo O=`git describe refs/heads/master` git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint diff --git a/cmds-ancillarymanipulators.txt b/cmds-ancillarymanipulators.txt index e392414fb..f33666575 100644 --- a/cmds-ancillarymanipulators.txt +++ b/cmds-ancillarymanipulators.txt @@ -4,6 +4,9 @@ gitlink:git-convert-objects[1]:: gitlink:git-fast-import[1]:: Backend for fast Git data importers. +gitlink:git-filter-branch[1]:: + Rewrite branches. + gitlink:git-lost-found[1]:: Recover lost refs that luckily have not yet been pruned. diff --git a/diff-options.txt b/diff-options.txt index 0f07c9c4a..3d2b9d0a0 100644 --- a/diff-options.txt +++ b/diff-options.txt @@ -168,5 +168,13 @@ --quiet:: Disable all output of the program. Implies --exit-code. +--ext-diff:: + Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. + +--no-ext-diff:: + Disallow external diff drivers. + For more detailed explanation on these common options, see also link:diffcore.html[diffcore documentation]. diff --git a/git-diff-files.html b/git-diff-files.html index b3b897044..f429f3b22 100644 --- a/git-diff-files.html +++ b/git-diff-files.html @@ -654,6 +654,24 @@ same as "git-diff-index" and "git-diff-tree".

Disable all output of the program. Implies --exit-code.

+
+--ext-diff +
+
+

+ Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. +

+
+
+--no-ext-diff +
+
+

+ Disallow external diff drivers. +

+

For more detailed explanation on these common options, see also diffcore documentation.

@@ -1076,7 +1094,7 @@ two unresolved merge parents with the working tree file diff --git a/git-diff-index.html b/git-diff-index.html index b26269e06..810bd09d0 100644 --- a/git-diff-index.html +++ b/git-diff-index.html @@ -655,6 +655,24 @@ entries in the index are compared.

Disable all output of the program. Implies --exit-code.

+
+--ext-diff +
+
+

+ Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. +

+
+
+--no-ext-diff +
+
+

+ Disallow external diff drivers. +

+

For more detailed explanation on these common options, see also diffcore documentation.

@@ -1158,7 +1176,7 @@ always have the special all-zero sha1. diff --git a/git-diff-tree.html b/git-diff-tree.html index b6ac10d7c..34f61ecfc 100644 --- a/git-diff-tree.html +++ b/git-diff-tree.html @@ -657,6 +657,24 @@ git-diff-tree(1) Manual Page Disable all output of the program. Implies --exit-code.

+
+--ext-diff +
+
+

+ Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. +

+
+
+--no-ext-diff +
+
+

+ Disallow external diff drivers. +

+

For more detailed explanation on these common options, see also diffcore documentation.

@@ -1536,7 +1554,7 @@ two unresolved merge parents with the working tree file diff --git a/git-diff.html b/git-diff.html index 4d450d5d5..39e96c3f7 100644 --- a/git-diff.html +++ b/git-diff.html @@ -709,6 +709,24 @@ any <tree-ish>.

Disable all output of the program. Implies --exit-code.

+
+--ext-diff +
+
+

+ Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. +

+
+
+--no-ext-diff +
+
+

+ Disallow external diff drivers. +

+

For more detailed explanation on these common options, see also diffcore documentation.

@@ -861,7 +879,7 @@ output diff in reverse. diff --git a/git-filter-branch.html b/git-filter-branch.html new file mode 100644 index 000000000..f241d88cb --- /dev/null +++ b/git-filter-branch.html @@ -0,0 +1,559 @@ + + + + + + +git-filter-branch(1) + + + +

SYNOPSIS

+
+
+
git-filter-branch [--env-filter <command>] [--tree-filter <command>] + [--index-filter <command>] [--parent-filter <command>] + [--msg-filter <command>] [--commit-filter <command>] + [--tag-name-filter <command>] [--subdirectory-filter <directory>] + [-d <directory>] <new-branch-name> [<rev-list options>…]
+
+

DESCRIPTION

+
+

Lets you rewrite git revision history by creating a new branch from +your current branch, applying custom filters on each revision. +Those filters can modify each tree (e.g. removing a file or running +a perl rewrite on all files) or information about each commit. +Otherwise, all information (including original commit times or merge +information) will be preserved.

+

The command takes the new branch name as a mandatory argument and +the filters as optional arguments. If you specify no filters, the +commits will be recommitted without any changes, which would normally +have no effect and result in the new branch pointing to the same +branch as your current branch. Nevertheless, this may be useful in +the future for compensating for some git bugs or such, therefore +such a usage is permitted.

+

WARNING! The rewritten history will have different object names for all +the objects and will not converge with the original branch. You will not +be able to easily push and distribute the rewritten branch on top of the +original branch. Please do not use this command if you do not know the +full implications, and avoid using it anyway, if a simple single commit +would suffice to fix your problem.

+

Always verify that the rewritten version is correct before disposing +the original branch.

+

Note that since this operation is extensively I/O expensive, it might +be a good idea to redirect the temporary directory off-disk, e.g. on +tmpfs. Reportedly the speedup is very noticeable.

+

Filters

+

The filters are applied in the order as listed below. The <command> +argument is always evaluated in shell using the eval command. +Prior to that, the $GIT_COMMIT environment variable will be set to contain +the id of the commit being rewritten. Also, GIT_AUTHOR_NAME, +GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, +and GIT_COMMITTER_DATE is set according to the current commit.

+

A map function is available that takes an "original sha1 id" argument +and outputs a "rewritten sha1 id" if the commit has been already +rewritten, fails otherwise; the map function can return several +ids on separate lines if your commit filter emitted multiple commits.

+
+

OPTIONS

+
+
+
+--env-filter <command> +
+
+

+ This is the filter for modifying the environment in which + the commit will be performed. Specifically, you might want + to rewrite the author/committer name/email/time environment + variables (see git-commit(1) for details). Do not forget + to re-export the variables. +

+
+
+--tree-filter <command> +
+
+

+ This is the filter for rewriting the tree and its contents. + The argument is evaluated in shell with the working + directory set to the root of the checked out tree. The new tree + is then used as-is (new files are auto-added, disappeared files + are auto-removed - neither .gitignore files nor any other ignore + rules HAVE ANY EFFECT!). +

+
+
+--index-filter <command> +
+
+

+ This is the filter for rewriting the index. It is similar to the + tree filter but does not check out the tree, which makes it much + faster. For hairy cases, see git-update-index(1). +

+
+
+--parent-filter <command> +
+
+

+ This is the filter for rewriting the commit's parent list. + It will receive the parent string on stdin and shall output + the new parent string on stdout. The parent string is in + a format accepted by git-commit-tree(1): empty for + the initial commit, "-p parent" for a normal commit and + "-p parent1 -p parent2 -p parent3 …" for a merge commit. +

+
+
+--msg-filter <command> +
+
+

+ This is the filter for rewriting the commit messages. + The argument is evaluated in the shell with the original + commit message on standard input; its standard output is + used as the new commit message. +

+
+
+--commit-filter <command> +
+
+

+ This is the filter for performing the commit. + If this filter is specified, it will be called instead of the + git-commit-tree(1) command, with arguments of the form + "<TREE_ID> [-p <PARENT_COMMIT_ID>]…" and the log message on + stdin. The commit id is expected on stdout. +

+

As a special extension, the commit filter may emit multiple +commit ids; in that case, ancestors of the original commit will +have all of them as parents.

+
+
+--tag-name-filter <command> +
+
+

+ This is the filter for rewriting tag names. When passed, + it will be called for every tag ref that points to a rewritten + object (or to a tag object which points to a rewritten object). + The original tag name is passed via standard input, and the new + tag name is expected on standard output. +

+

The original tags are not deleted, but can be overwritten; +use "--tag-name-filter=cat" to simply update the tags. In this +case, be very careful and make sure you have the old tags +backed up in case the conversion has run afoul.

+

Note that there is currently no support for proper rewriting of +tag objects; in layman terms, if the tag has a message or signature +attached, the rewritten tag won't have it. Sorry. (It is by +definition impossible to preserve signatures at any rate.)

+
+
+--subdirectory-filter <directory> +
+
+

+ Only ever look at the history, which touches the given subdirectory. + The result will contain that directory as its project root. +

+
+
+-d <directory> +
+
+

+ Use this option to set the path to the temporary directory used for + rewriting. When applying a tree filter, the command needs to + temporary checkout the tree to some directory, which may consume + considerable space in case of large projects. By default it + does this in the .git-rewrite/ directory but you can override + that choice by this parameter. +

+
+
+<rev-list-options> +
+
+

+ When options are given after the new branch name, they will + be passed to git-rev-list(1). Only commits in the resulting + output will be filtered, although the filtered commits can still + reference parents which are outside of that set. +

+
+
+
+

Examples

+
+

Suppose you want to remove a file (containing confidential information +or copyright violation) from all commits:

+
+
+
git filter-branch --tree-filter 'rm filename' newbranch
+
+

A significantly faster version:

+
+
+
git filter-branch --index-filter 'git update-index --remove filename' newbranch
+
+

Now, you will get the rewritten history saved in the branch newbranch +(your current branch is left untouched).

+

To "etch-graft" a commit to the revision history (set a commit to be +the parent of the current initial commit and propagate that):

+
+
+
git filter-branch --parent-filter sed\ 's/^$/-p <graft-id>/' newbranch
+
+

(if the parent string is empty - therefore we are dealing with the +initial commit - add graftcommit as a parent). Note that this assumes +history with a single root (that is, no merge without common ancestors +happened). If this is not the case, use:

+
+
+
git filter-branch --parent-filter \
+        'cat; test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>"' newbranch
+
+

To remove commits authored by "Darl McBribe" from the history:

+
+
+
git filter-branch --commit-filter '
+        if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ];
+        then
+                shift;
+                while [ -n "$1" ];
+                do
+                        shift;
+                        echo "$1";
+                        shift;
+                done;
+        else
+                git commit-tree "$@";
+        fi' newbranch
+
+

The shift magic first throws away the tree id and then the -p +parameters. Note that this handles merges properly! In case Darl +committed a merge between P1 and P2, it will be propagated properly +and all children of the merge will become merge commits with P1,P2 +as their parents instead of the merge commit.

+

To restrict rewriting to only part of the history, specify a revision +range in addition to the new branch name. The new branch name will +point to the top-most revision that a git rev-list of this range +will print.

+

Note that the changes introduced by the commits, and not reverted by +subsequent commits, will still be in the rewritten branch. If you want +to throw out _changes_ together with the commits, you should use the +interactive mode of git-rebase(1).

+

Consider this history:

+
+
+
     D--E--F--G--H
+    /     /
+A--B-----C
+
+

To rewrite only commits D,E,F,G,H, but leave A, B and C alone, use:

+
+
+
git filter-branch ... new-H C..H
+
+

To rewrite commits E,F,G,H, use one of these:

+
+
+
git filter-branch ... new-H C..H --not D
+git filter-branch ... new-H D..H --not C
+
+

To move the whole tree into a subdirectory, or remove it from there:

+
+
+
git filter-branch --index-filter \
+        'git ls-files -s | sed "s-\t-&newsubdir/-" |
+                GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
+                        git update-index --index-info &&
+         mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved
+
+
+

Author

+
+

Written by Petr "Pasky" Baudis <pasky@suse.cz>, +and the git list <git@vger.kernel.org>

+
+

Documentation

+
+

Documentation by Petr Baudis and the git list.

+
+

GIT

+
+

Part of the git(7) suite

+
+ + + diff --git a/git-filter-branch.txt b/git-filter-branch.txt new file mode 100644 index 000000000..2074f319a --- /dev/null +++ b/git-filter-branch.txt @@ -0,0 +1,262 @@ +git-filter-branch(1) +==================== + +NAME +---- +git-filter-branch - Rewrite branches + +SYNOPSIS +-------- +[verse] +'git-filter-branch' [--env-filter ] [--tree-filter ] + [--index-filter ] [--parent-filter ] + [--msg-filter ] [--commit-filter ] + [--tag-name-filter ] [--subdirectory-filter ] + [-d ] [...] + +DESCRIPTION +----------- +Lets you rewrite git revision history by creating a new branch from +your current branch, applying custom filters on each revision. +Those filters can modify each tree (e.g. removing a file or running +a perl rewrite on all files) or information about each commit. +Otherwise, all information (including original commit times or merge +information) will be preserved. + +The command takes the new branch name as a mandatory argument and +the filters as optional arguments. If you specify no filters, the +commits will be recommitted without any changes, which would normally +have no effect and result in the new branch pointing to the same +branch as your current branch. Nevertheless, this may be useful in +the future for compensating for some git bugs or such, therefore +such a usage is permitted. + +WARNING! The rewritten history will have different object names for all +the objects and will not converge with the original branch. You will not +be able to easily push and distribute the rewritten branch on top of the +original branch. Please do not use this command if you do not know the +full implications, and avoid using it anyway, if a simple single commit +would suffice to fix your problem. + +Always verify that the rewritten version is correct before disposing +the original branch. + +Note that since this operation is extensively I/O expensive, it might +be a good idea to redirect the temporary directory off-disk, e.g. on +tmpfs. Reportedly the speedup is very noticeable. + + +Filters +~~~~~~~ + +The filters are applied in the order as listed below. The +argument is always evaluated in shell using the 'eval' command. +Prior to that, the $GIT_COMMIT environment variable will be set to contain +the id of the commit being rewritten. Also, GIT_AUTHOR_NAME, +GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, +and GIT_COMMITTER_DATE is set according to the current commit. + +A 'map' function is available that takes an "original sha1 id" argument +and outputs a "rewritten sha1 id" if the commit has been already +rewritten, fails otherwise; the 'map' function can return several +ids on separate lines if your commit filter emitted multiple commits. + + +OPTIONS +------- + +--env-filter :: + This is the filter for modifying the environment in which + the commit will be performed. Specifically, you might want + to rewrite the author/committer name/email/time environment + variables (see gitlink:git-commit[1] for details). Do not forget + to re-export the variables. + +--tree-filter :: + This is the filter for rewriting the tree and its contents. + The argument is evaluated in shell with the working + directory set to the root of the checked out tree. The new tree + is then used as-is (new files are auto-added, disappeared files + are auto-removed - neither .gitignore files nor any other ignore + rules HAVE ANY EFFECT!). + +--index-filter :: + This is the filter for rewriting the index. It is similar to the + tree filter but does not check out the tree, which makes it much + faster. For hairy cases, see gitlink:git-update-index[1]. + +--parent-filter :: + This is the filter for rewriting the commit's parent list. + It will receive the parent string on stdin and shall output + the new parent string on stdout. The parent string is in + a format accepted by gitlink:git-commit-tree[1]: empty for + the initial commit, "-p parent" for a normal commit and + "-p parent1 -p parent2 -p parent3 ..." for a merge commit. + +--msg-filter :: + This is the filter for rewriting the commit messages. + The argument is evaluated in the shell with the original + commit message on standard input; its standard output is + used as the new commit message. + +--commit-filter :: + This is the filter for performing the commit. + If this filter is specified, it will be called instead of the + gitlink:git-commit-tree[1] command, with arguments of the form + " [-p ]..." and the log message on + stdin. The commit id is expected on stdout. ++ +As a special extension, the commit filter may emit multiple +commit ids; in that case, ancestors of the original commit will +have all of them as parents. + +--tag-name-filter :: + This is the filter for rewriting tag names. When passed, + it will be called for every tag ref that points to a rewritten + object (or to a tag object which points to a rewritten object). + The original tag name is passed via standard input, and the new + tag name is expected on standard output. ++ +The original tags are not deleted, but can be overwritten; +use "--tag-name-filter=cat" to simply update the tags. In this +case, be very careful and make sure you have the old tags +backed up in case the conversion has run afoul. ++ +Note that there is currently no support for proper rewriting of +tag objects; in layman terms, if the tag has a message or signature +attached, the rewritten tag won't have it. Sorry. (It is by +definition impossible to preserve signatures at any rate.) + +--subdirectory-filter :: + Only ever look at the history, which touches the given subdirectory. + The result will contain that directory as its project root. + +-d :: + Use this option to set the path to the temporary directory used for + rewriting. When applying a tree filter, the command needs to + temporary checkout the tree to some directory, which may consume + considerable space in case of large projects. By default it + does this in the '.git-rewrite/' directory but you can override + that choice by this parameter. + +:: + When options are given after the new branch name, they will + be passed to gitlink:git-rev-list[1]. Only commits in the resulting + output will be filtered, although the filtered commits can still + reference parents which are outside of that set. + + +Examples +-------- + +Suppose you want to remove a file (containing confidential information +or copyright violation) from all commits: + +------------------------------------------------------- +git filter-branch --tree-filter 'rm filename' newbranch +------------------------------------------------------- + +A significantly faster version: + +------------------------------------------------------------------------------- +git filter-branch --index-filter 'git update-index --remove filename' newbranch +------------------------------------------------------------------------------- + +Now, you will get the rewritten history saved in the branch 'newbranch' +(your current branch is left untouched). + +To "etch-graft" a commit to the revision history (set a commit to be +the parent of the current initial commit and propagate that): + +---------------------------------------------------------------------- +git filter-branch --parent-filter sed\ 's/^$/-p /' newbranch +---------------------------------------------------------------------- + +(if the parent string is empty - therefore we are dealing with the +initial commit - add graftcommit as a parent). Note that this assumes +history with a single root (that is, no merge without common ancestors +happened). If this is not the case, use: + +------------------------------------------------------------------------------- +git filter-branch --parent-filter \ + 'cat; test $GIT_COMMIT = && echo "-p "' newbranch +------------------------------------------------------------------------------- + +To remove commits authored by "Darl McBribe" from the history: + +------------------------------------------------------------------------------ +git filter-branch --commit-filter ' + if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ]; + then + shift; + while [ -n "$1" ]; + do + shift; + echo "$1"; + shift; + done; + else + git commit-tree "$@"; + fi' newbranch +------------------------------------------------------------------------------ + +The shift magic first throws away the tree id and then the -p +parameters. Note that this handles merges properly! In case Darl +committed a merge between P1 and P2, it will be propagated properly +and all children of the merge will become merge commits with P1,P2 +as their parents instead of the merge commit. + +To restrict rewriting to only part of the history, specify a revision +range in addition to the new branch name. The new branch name will +point to the top-most revision that a 'git rev-list' of this range +will print. + +Note that the changes introduced by the commits, and not reverted by +subsequent commits, will still be in the rewritten branch. If you want +to throw out _changes_ together with the commits, you should use the +interactive mode of gitlink:git-rebase[1]. + +Consider this history: + +------------------ + D--E--F--G--H + / / +A--B-----C +------------------ + +To rewrite only commits D,E,F,G,H, but leave A, B and C alone, use: + +-------------------------------- +git filter-branch ... new-H C..H +-------------------------------- + +To rewrite commits E,F,G,H, use one of these: + +---------------------------------------- +git filter-branch ... new-H C..H --not D +git filter-branch ... new-H D..H --not C +---------------------------------------- + +To move the whole tree into a subdirectory, or remove it from there: + +--------------------------------------------------------------- +git filter-branch --index-filter \ + 'git ls-files -s | sed "s-\t-&newsubdir/-" | + GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ + git update-index --index-info && + mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved +--------------------------------------------------------------- + + +Author +------ +Written by Petr "Pasky" Baudis , +and the git list + +Documentation +-------------- +Documentation by Petr Baudis and the git list. + +GIT +--- +Part of the gitlink:git[7] suite diff --git a/git-format-patch.html b/git-format-patch.html index 05b0da062..b38bbc5f2 100644 --- a/git-format-patch.html +++ b/git-format-patch.html @@ -680,11 +680,37 @@ reference.

Disable all output of the program. Implies --exit-code.

+
+--ext-diff +
+
+

+ Allow an external diff helper to be executed. If you set an + external diff driver with gitlink:gitattributes(5), you need + to use this option with gitlink:git-log(1) and friends. +

+
+
+--no-ext-diff +
+
+

+ Disallow external diff drivers. +

+

For more detailed explanation on these common options, see also diffcore documentation.

+-<n> +
+
+

+ Limits the number of patches to prepare. +

+
+
-o|--output-directory <dir>
@@ -904,7 +930,7 @@ git-format-patch -3 diff --git a/git-format-patch.txt b/git-format-patch.txt index e5638102e..6cbcf937b 100644 --- a/git-format-patch.txt +++ b/git-format-patch.txt @@ -53,6 +53,9 @@ OPTIONS ------- include::diff-options.txt[] +-:: + Limits the number of patches to prepare. + -o|--output-directory :: Use to store the resulting files, instead of the current working directory. diff --git a/git-fsck.html b/git-fsck.html index 91af94b7f..3d172a42a 100644 --- a/git-fsck.html +++ b/git-fsck.html @@ -378,8 +378,8 @@ index file and all SHA1 references in .git/refs/* as heads.

- Write dangling refs into .git/commit/ or .git/other/, depending - on type. + Write dangling refs into .git/lost-found/commit/ or + .git/lost-found/other/, depending on type.

@@ -519,7 +519,7 @@ GIT_ALTERNATE_OBJECT_DIRECTORIES diff --git a/git-fsck.txt b/git-fsck.txt index 08512e0b8..1a432f231 100644 --- a/git-fsck.txt +++ b/git-fsck.txt @@ -65,8 +65,8 @@ index file and all SHA1 references in .git/refs/* as heads. Be chatty. --lost-found:: - Write dangling refs into .git/commit/ or .git/other/, depending - on type. + Write dangling refs into .git/lost-found/commit/ or + .git/lost-found/other/, depending on type. It tests SHA1 and general object sanity, and it does full tracking of the resulting reachability and everything else. It prints out any diff --git a/git.html b/git.html index b8f94f3fe..427496174 100644 --- a/git.html +++ b/git.html @@ -697,6 +697,14 @@ ancillary user utilities.

+git-filter-branch(1) +
+
+

+ Rewrite branches. +

+
+
git-lost-found(1)
@@ -2390,7 +2398,7 @@ contributors on the git-list <git@vger.kernel.org>.

diff --git a/glossary.html b/glossary.html index 107ee54ed..820ac9229 100644 --- a/glossary.html +++ b/glossary.html @@ -856,6 +856,17 @@ This commit is referred to as a "merge commit", or sometimes just a

+reflog +
+
+

+ A reflog shows the local "history" of a ref. In other words, + it can tell you what the 3rd last revision in _this_ repository + was, and what was the current state in _this_ repository, + yesterday 9:14pm. See git-reflog(1) for details. +

+
+
refspec
@@ -1069,7 +1080,7 @@ This commit is referred to as a "merge commit", or sometimes just a diff --git a/glossary.txt b/glossary.txt index e903abfeb..3f7b1e42b 100644 --- a/glossary.txt +++ b/glossary.txt @@ -330,6 +330,12 @@ This commit is referred to as a "merge commit", or sometimes just a denotes a particular <>. These may be stored in `$GIT_DIR/refs/`. +[[def_reflog]]reflog:: + A reflog shows the local "history" of a ref. In other words, + it can tell you what the 3rd last revision in _this_ repository + was, and what was the current state in _this_ repository, + yesterday 9:14pm. See gitlink:git-reflog[1] for details. + [[def_refspec]]refspec:: A "refspec" is used by <> and <> to describe the mapping between remote diff --git a/user-manual.html b/user-manual.html index e58205d70..e08c53150 100644 --- a/user-manual.html +++ b/user-manual.html @@ -1944,6 +1944,13 @@ This commit is referred to as a "merge commit", or sometimes just a denotes a particular object. These may be stored in $GIT_DIR/refs/.
+reflog +
+ A reflog shows the local "history" of a ref. In other words, + it can tell you what the 3rd last revision in _this_ repository + was, and what was the current state in _this_ repository, + yesterday 9:14pm. See git-reflog(1) for details. +
refspec
A "refspec" is used by fetch and -- 2.26.2