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.
* 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.
- "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
- "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.
$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.
- "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
.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.
--
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
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.
--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].
Disable all output of the program. Implies --exit-code.\r
</p>\r
</dd>\r
+<dt>\r
+--ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow an external diff helper to be executed. If you set an\r
+ external diff driver with gitlink:gitattributes(5), you need\r
+ to use this option with gitlink:git-log(1) and friends.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disallow external diff drivers.\r
+</p>\r
+</dd>\r
</dl>\r
<p>For more detailed explanation on these common options, see also\r
<a href="diffcore.html">diffcore documentation</a>.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 02-Jul-2007 00:16:57 UTC\r
+Last updated 04-Jul-2007 06:40:52 UTC\r
</div>\r
</div>\r
</body>\r
Disable all output of the program. Implies --exit-code.\r
</p>\r
</dd>\r
+<dt>\r
+--ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow an external diff helper to be executed. If you set an\r
+ external diff driver with gitlink:gitattributes(5), you need\r
+ to use this option with gitlink:git-log(1) and friends.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disallow external diff drivers.\r
+</p>\r
+</dd>\r
</dl>\r
<p>For more detailed explanation on these common options, see also\r
<a href="diffcore.html">diffcore documentation</a>.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 02-Jul-2007 00:16:58 UTC\r
+Last updated 04-Jul-2007 06:40:52 UTC\r
</div>\r
</div>\r
</body>\r
Disable all output of the program. Implies --exit-code.\r
</p>\r
</dd>\r
+<dt>\r
+--ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow an external diff helper to be executed. If you set an\r
+ external diff driver with gitlink:gitattributes(5), you need\r
+ to use this option with gitlink:git-log(1) and friends.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disallow external diff drivers.\r
+</p>\r
+</dd>\r
</dl>\r
<p>For more detailed explanation on these common options, see also\r
<a href="diffcore.html">diffcore documentation</a>.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 02-Jul-2007 00:16:59 UTC\r
+Last updated 04-Jul-2007 06:40:53 UTC\r
</div>\r
</div>\r
</body>\r
Disable all output of the program. Implies --exit-code.\r
</p>\r
</dd>\r
+<dt>\r
+--ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow an external diff helper to be executed. If you set an\r
+ external diff driver with gitlink:gitattributes(5), you need\r
+ to use this option with gitlink:git-log(1) and friends.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disallow external diff drivers.\r
+</p>\r
+</dd>\r
</dl>\r
<p>For more detailed explanation on these common options, see also\r
<a href="diffcore.html">diffcore documentation</a>.</p>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Jun-2007 09:49:02 UTC\r
+Last updated 04-Jul-2007 06:40:53 UTC\r
</div>\r
</div>\r
</body>\r
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 7.0.2" />\r
+<style type="text/css">\r
+/* Debug borders */\r
+p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {\r
+/*\r
+ border: 1px solid red;\r
+*/\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a { color: blue; }\r
+a:visited { color: fuchsia; }\r
+\r
+em {\r
+ font-style: italic;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+}\r
+\r
+tt {\r
+ color: navy;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ font-family: sans-serif;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ border-bottom: 2px solid silver;\r
+ padding-top: 0.5em;\r
+}\r
+\r
+div.sectionbody {\r
+ font-family: serif;\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+pre {\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+\r
+span#author {\r
+ color: #527bbd;\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ font-size: 1.2em;\r
+}\r
+span#email {\r
+}\r
+span#revision {\r
+ font-family: sans-serif;\r
+}\r
+\r
+div#footer {\r
+ font-family: sans-serif;\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+div#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+div#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+div#preamble,\r
+div.tableblock, div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-right: 10%;\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.5em;\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid silver;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid silver;\r
+ background: #f4f4f4;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock > div.content {\r
+ padding-left: 2.0em;\r
+}\r
+div.quoteblock .attribution {\r
+ text-align: right;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 2px solid silver;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 2px solid silver;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.verseblock div.content {\r
+ white-space: pre;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+div.imageblock img { border: 1px solid silver; }\r
+span.image img { border-style: none; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: italic;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.olist2 {\r
+ list-style-type: lower-alpha;\r
+}\r
+\r
+div.tableblock > table {\r
+ border-color: #527bbd;\r
+ border-width: 3px;\r
+}\r
+thead {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+}\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+\r
+div.hlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+td.hlist1 {\r
+ vertical-align: top;\r
+ font-style: italic;\r
+ padding-right: 0.8em;\r
+}\r
+td.hlist2 {\r
+ vertical-align: top;\r
+}\r
+\r
+@media print {\r
+ div#footer-badges { display: none; }\r
+}\r
+include::./stylesheets/xhtml11-manpage.css[]\r
+/* Workarounds for IE6's broken and incomplete CSS2. */\r
+\r
+div.sidebar-content {\r
+ background: #ffffee;\r
+ border: 1px solid silver;\r
+ padding: 0.5em;\r
+}\r
+div.sidebar-title, div.image-title {\r
+ font-family: sans-serif;\r
+ font-weight: bold;\r
+ margin-top: 0.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+div.listingblock div.content {\r
+ border: 1px solid silver;\r
+ background: #f4f4f4;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock-content {\r
+ padding-left: 2.0em;\r
+}\r
+\r
+div.exampleblock-content {\r
+ border-left: 2px solid silver;\r
+ padding-left: 0.5em;\r
+}\r
+</style>\r
+<title>git-filter-branch(1)</title>\r
+</head>\r
+<body>\r
+<div id="header">\r
+<h1>\r
+git-filter-branch(1) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>git-filter-branch -\r
+ Rewrite branches\r
+</p>\r
+</div>\r
+</div>\r
+<h2>SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="verseblock">\r
+<div class="content"><em>git-filter-branch</em> [--env-filter <command>] [--tree-filter <command>]\r
+ [--index-filter <command>] [--parent-filter <command>]\r
+ [--msg-filter <command>] [--commit-filter <command>]\r
+ [--tag-name-filter <command>] [--subdirectory-filter <directory>]\r
+ [-d <directory>] <new-branch-name> [<rev-list options>…]</div></div>\r
+</div>\r
+<h2>DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<p>Lets you rewrite git revision history by creating a new branch from\r
+your current branch, applying custom filters on each revision.\r
+Those filters can modify each tree (e.g. removing a file or running\r
+a perl rewrite on all files) or information about each commit.\r
+Otherwise, all information (including original commit times or merge\r
+information) will be preserved.</p>\r
+<p>The command takes the new branch name as a mandatory argument and\r
+the filters as optional arguments. If you specify no filters, the\r
+commits will be recommitted without any changes, which would normally\r
+have no effect and result in the new branch pointing to the same\r
+branch as your current branch. Nevertheless, this may be useful in\r
+the future for compensating for some git bugs or such, therefore\r
+such a usage is permitted.</p>\r
+<p>WARNING! The rewritten history will have different object names for all\r
+the objects and will not converge with the original branch. You will not\r
+be able to easily push and distribute the rewritten branch on top of the\r
+original branch. Please do not use this command if you do not know the\r
+full implications, and avoid using it anyway, if a simple single commit\r
+would suffice to fix your problem.</p>\r
+<p>Always verify that the rewritten version is correct before disposing\r
+the original branch.</p>\r
+<p>Note that since this operation is extensively I/O expensive, it might\r
+be a good idea to redirect the temporary directory off-disk, e.g. on\r
+tmpfs. Reportedly the speedup is very noticeable.</p>\r
+<h3>Filters</h3>\r
+<p>The filters are applied in the order as listed below. The <command>\r
+argument is always evaluated in shell using the <em>eval</em> command.\r
+Prior to that, the $GIT_COMMIT environment variable will be set to contain\r
+the id of the commit being rewritten. Also, GIT_AUTHOR_NAME,\r
+GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,\r
+and GIT_COMMITTER_DATE is set according to the current commit.</p>\r
+<p>A <em>map</em> function is available that takes an "original sha1 id" argument\r
+and outputs a "rewritten sha1 id" if the commit has been already\r
+rewritten, fails otherwise; the <em>map</em> function can return several\r
+ids on separate lines if your commit filter emitted multiple commits.</p>\r
+</div>\r
+<h2>OPTIONS</h2>\r
+<div class="sectionbody">\r
+<dl>\r
+<dt>\r
+--env-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for modifying the environment in which\r
+ the commit will be performed. Specifically, you might want\r
+ to rewrite the author/committer name/email/time environment\r
+ variables (see <a href="git-commit.html">git-commit(1)</a> for details). Do not forget\r
+ to re-export the variables.\r
+</p>\r
+</dd>\r
+<dt>\r
+--tree-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for rewriting the tree and its contents.\r
+ The argument is evaluated in shell with the working\r
+ directory set to the root of the checked out tree. The new tree\r
+ is then used as-is (new files are auto-added, disappeared files\r
+ are auto-removed - neither .gitignore files nor any other ignore\r
+ rules HAVE ANY EFFECT!).\r
+</p>\r
+</dd>\r
+<dt>\r
+--index-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for rewriting the index. It is similar to the\r
+ tree filter but does not check out the tree, which makes it much\r
+ faster. For hairy cases, see <a href="git-update-index.html">git-update-index(1)</a>.\r
+</p>\r
+</dd>\r
+<dt>\r
+--parent-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for rewriting the commit's parent list.\r
+ It will receive the parent string on stdin and shall output\r
+ the new parent string on stdout. The parent string is in\r
+ a format accepted by <a href="git-commit-tree.html">git-commit-tree(1)</a>: empty for\r
+ the initial commit, "-p parent" for a normal commit and\r
+ "-p parent1 -p parent2 -p parent3 …" for a merge commit.\r
+</p>\r
+</dd>\r
+<dt>\r
+--msg-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for rewriting the commit messages.\r
+ The argument is evaluated in the shell with the original\r
+ commit message on standard input; its standard output is\r
+ used as the new commit message.\r
+</p>\r
+</dd>\r
+<dt>\r
+--commit-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for performing the commit.\r
+ If this filter is specified, it will be called instead of the\r
+ <a href="git-commit-tree.html">git-commit-tree(1)</a> command, with arguments of the form\r
+ "<TREE_ID> [-p <PARENT_COMMIT_ID>]…" and the log message on\r
+ stdin. The commit id is expected on stdout.\r
+</p>\r
+<p>As a special extension, the commit filter may emit multiple\r
+commit ids; in that case, ancestors of the original commit will\r
+have all of them as parents.</p>\r
+</dd>\r
+<dt>\r
+--tag-name-filter <command>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is the filter for rewriting tag names. When passed,\r
+ it will be called for every tag ref that points to a rewritten\r
+ object (or to a tag object which points to a rewritten object).\r
+ The original tag name is passed via standard input, and the new\r
+ tag name is expected on standard output.\r
+</p>\r
+<p>The original tags are not deleted, but can be overwritten;\r
+use "--tag-name-filter=cat" to simply update the tags. In this\r
+case, be very careful and make sure you have the old tags\r
+backed up in case the conversion has run afoul.</p>\r
+<p>Note that there is currently no support for proper rewriting of\r
+tag objects; in layman terms, if the tag has a message or signature\r
+attached, the rewritten tag won't have it. Sorry. (It is by\r
+definition impossible to preserve signatures at any rate.)</p>\r
+</dd>\r
+<dt>\r
+--subdirectory-filter <directory>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Only ever look at the history, which touches the given subdirectory.\r
+ The result will contain that directory as its project root.\r
+</p>\r
+</dd>\r
+<dt>\r
+-d <directory>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Use this option to set the path to the temporary directory used for\r
+ rewriting. When applying a tree filter, the command needs to\r
+ temporary checkout the tree to some directory, which may consume\r
+ considerable space in case of large projects. By default it\r
+ does this in the <em>.git-rewrite/</em> directory but you can override\r
+ that choice by this parameter.\r
+</p>\r
+</dd>\r
+<dt>\r
+<rev-list-options>\r
+</dt>\r
+<dd>\r
+<p>\r
+ When options are given after the new branch name, they will\r
+ be passed to <a href="git-rev-list.html">git-rev-list(1)</a>. Only commits in the resulting\r
+ output will be filtered, although the filtered commits can still\r
+ reference parents which are outside of that set.\r
+</p>\r
+</dd>\r
+</dl>\r
+</div>\r
+<h2>Examples</h2>\r
+<div class="sectionbody">\r
+<p>Suppose you want to remove a file (containing confidential information\r
+or copyright violation) from all commits:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch --tree-filter 'rm filename' newbranch</tt></pre>\r
+</div></div>\r
+<p>A significantly faster version:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch --index-filter 'git update-index --remove filename' newbranch</tt></pre>\r
+</div></div>\r
+<p>Now, you will get the rewritten history saved in the branch <em>newbranch</em>\r
+(your current branch is left untouched).</p>\r
+<p>To "etch-graft" a commit to the revision history (set a commit to be\r
+the parent of the current initial commit and propagate that):</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch --parent-filter sed\ 's/^$/-p <graft-id>/' newbranch</tt></pre>\r
+</div></div>\r
+<p>(if the parent string is empty - therefore we are dealing with the\r
+initial commit - add graftcommit as a parent). Note that this assumes\r
+history with a single root (that is, no merge without common ancestors\r
+happened). If this is not the case, use:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch --parent-filter \\r
+ 'cat; test $GIT_COMMIT = <commit-id> && echo "-p <graft-id>"' newbranch</tt></pre>\r
+</div></div>\r
+<p>To remove commits authored by "Darl McBribe" from the history:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch --commit-filter '\r
+ if [ "$GIT_AUTHOR_NAME" = "Darl McBribe" ];\r
+ then\r
+ shift;\r
+ while [ -n "$1" ];\r
+ do\r
+ shift;\r
+ echo "$1";\r
+ shift;\r
+ done;\r
+ else\r
+ git commit-tree "$@";\r
+ fi' newbranch</tt></pre>\r
+</div></div>\r
+<p>The shift magic first throws away the tree id and then the -p\r
+parameters. Note that this handles merges properly! In case Darl\r
+committed a merge between P1 and P2, it will be propagated properly\r
+and all children of the merge will become merge commits with P1,P2\r
+as their parents instead of the merge commit.</p>\r
+<p>To restrict rewriting to only part of the history, specify a revision\r
+range in addition to the new branch name. The new branch name will\r
+point to the top-most revision that a <em>git rev-list</em> of this range\r
+will print.</p>\r
+<p>Note that the changes introduced by the commits, and not reverted by\r
+subsequent commits, will still be in the rewritten branch. If you want\r
+to throw out _changes_ together with the commits, you should use the\r
+interactive mode of <a href="git-rebase.html">git-rebase(1)</a>.</p>\r
+<p>Consider this history:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt> D--E--F--G--H\r
+ / /\r
+A--B-----C</tt></pre>\r
+</div></div>\r
+<p>To rewrite only commits D,E,F,G,H, but leave A, B and C alone, use:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch ... new-H C..H</tt></pre>\r
+</div></div>\r
+<p>To rewrite commits E,F,G,H, use one of these:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch ... new-H C..H --not D\r
+git filter-branch ... new-H D..H --not C</tt></pre>\r
+</div></div>\r
+<p>To move the whole tree into a subdirectory, or remove it from there:</p>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><tt>git filter-branch --index-filter \\r
+ 'git ls-files -s | sed "s-\t-&newsubdir/-" |\r
+ GIT_INDEX_FILE=$GIT_INDEX_FILE.new \\r
+ git update-index --index-info &&\r
+ mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved</tt></pre>\r
+</div></div>\r
+</div>\r
+<h2>Author</h2>\r
+<div class="sectionbody">\r
+<p>Written by Petr "Pasky" Baudis <pasky@suse.cz>,\r
+and the git list <git@vger.kernel.org></p>\r
+</div>\r
+<h2>Documentation</h2>\r
+<div class="sectionbody">\r
+<p>Documentation by Petr Baudis and the git list.</p>\r
+</div>\r
+<h2>GIT</h2>\r
+<div class="sectionbody">\r
+<p>Part of the <a href="git.html">git(7)</a> suite</p>\r
+</div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+Last updated 04-Jul-2007 06:40:54 UTC\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
--- /dev/null
+git-filter-branch(1)
+====================
+
+NAME
+----
+git-filter-branch - Rewrite branches
+
+SYNOPSIS
+--------
+[verse]
+'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 gitlink: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 gitlink: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 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 <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
+ gitlink: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 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 <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 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 <pasky@suse.cz>,
+and the git list <git@vger.kernel.org>
+
+Documentation
+--------------
+Documentation by Petr Baudis and the git list.
+
+GIT
+---
+Part of the gitlink:git[7] suite
Disable all output of the program. Implies --exit-code.\r
</p>\r
</dd>\r
+<dt>\r
+--ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allow an external diff helper to be executed. If you set an\r
+ external diff driver with gitlink:gitattributes(5), you need\r
+ to use this option with gitlink:git-log(1) and friends.\r
+</p>\r
+</dd>\r
+<dt>\r
+--no-ext-diff\r
+</dt>\r
+<dd>\r
+<p>\r
+ Disallow external diff drivers.\r
+</p>\r
+</dd>\r
</dl>\r
<p>For more detailed explanation on these common options, see also\r
<a href="diffcore.html">diffcore documentation</a>.</p>\r
<dl>\r
<dt>\r
+-<n>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Limits the number of patches to prepare.\r
+</p>\r
+</dd>\r
+<dt>\r
-o|--output-directory <dir>\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 03-Jul-2007 07:03:40 UTC\r
+Last updated 04-Jul-2007 06:40:54 UTC\r
</div>\r
</div>\r
</body>\r
-------
include::diff-options.txt[]
+-<n>::
+ Limits the number of patches to prepare.
+
-o|--output-directory <dir>::
Use <dir> to store the resulting files, instead of the
current working directory.
</dt>\r
<dd>\r
<p>\r
- Write dangling refs into .git/commit/ or .git/other/, depending\r
- on type.\r
+ Write dangling refs into .git/lost-found/commit/ or\r
+ .git/lost-found/other/, depending on type.\r
</p>\r
</dd>\r
</dl>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 03-Jul-2007 07:03:41 UTC\r
+Last updated 04-Jul-2007 06:40:54 UTC\r
</div>\r
</div>\r
</body>\r
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
</p>\r
</dd>\r
<dt>\r
+<a href="git-filter-branch.html">git-filter-branch(1)</a>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Rewrite branches.\r
+</p>\r
+</dd>\r
+<dt>\r
<a href="git-lost-found.html">git-lost-found(1)</a>\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 03-Jul-2007 07:03:47 UTC\r
+Last updated 04-Jul-2007 06:40:55 UTC\r
</div>\r
</div>\r
</body>\r
</p>\r
</dd>\r
<dt>\r
+<a id="def_reflog"></a>reflog\r
+</dt>\r
+<dd>\r
+<p>\r
+ A reflog shows the local "history" of a ref. In other words,\r
+ it can tell you what the 3rd last revision in _this_ repository\r
+ was, and what was the current state in _this_ repository,\r
+ yesterday 9:14pm. See <a href="git-reflog.html">git-reflog(1)</a> for details.\r
+</p>\r
+</dd>\r
+<dt>\r
<a id="def_refspec"></a>refspec\r
</dt>\r
<dd>\r
</div>\r
<div id="footer">\r
<div id="footer-text">\r
-Last updated 16-Jun-2007 09:49:32 UTC\r
+Last updated 04-Jul-2007 06:40:56 UTC\r
</div>\r
</div>\r
</body>\r
denotes a particular <<def_object,object>>. 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 <<def_fetch,fetch>> and
<<def_push,push>> to describe the mapping between remote
denotes a particular <a href="#def_object">object</a>. These may be stored in
<code class="literal">$GIT_DIR/refs/</code>.
</dd><dt><span class="term">
+<a name="def_reflog"></a>reflog
+</span></dt><dd>
+ 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 <a href="git-reflog.html" target="_top">git-reflog(1)</a> for details.
+</dd><dt><span class="term">
<a name="def_refspec"></a>refspec
</span></dt><dd>
A "refspec" is used by <a href="#def_fetch">fetch</a> and