Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
docs:git:filter-branch [2010/04/14 22:14] – created billh | docs:git:filter-branch [2010/04/14 22:53] (current) – billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== git filter-branch ====== | ====== git filter-branch ====== | ||
- | git filter-branch allows you to rewrite history of any size. For example, you could change the author' | + | git filter-branch allows you to rewrite history of any size. For example, you could change the author' |
+ | |||
+ | You can change various things conditionally, | ||
+ | |||
+ | ===== change date of one or more commits ===== | ||
+ | * -d < | ||
+ | <code bash> | ||
+ | # | ||
+ | |||
+ | git filter-branch --env-filter ' | ||
+ | if [ $GIT_COMMIT = " | ||
+ | dt=" | ||
+ | export GIT_AUTHOR_DATE=$dt | ||
+ | export GIT_COMMITTER_DATE=$dt | ||
+ | fi | ||
+ | if [ $GIT_COMMIT = " | ||
+ | dt=" | ||
+ | export GIT_AUTHOR_DATE=$dt | ||
+ | export GIT_COMMITTER_DATE=$dt | ||
+ | fi | ||
+ | if [ $GIT_COMMIT = " | ||
+ | dt=" | ||
+ | export GIT_AUTHOR_DATE=$dt | ||
+ | export GIT_COMMITTER_DATE=$dt | ||
+ | fi | ||
+ | if [ $GIT_COMMIT = " | ||
+ | dt=" | ||
+ | export GIT_AUTHOR_DATE=$dt | ||
+ | export GIT_COMMITTER_DATE=$dt | ||
+ | fi | ||
+ | ' -d tmp \ | ||
+ | HEAD | ||
+ | </ | ||
+ | |||
+ | ===== remove svn id strings ===== | ||
+ | <code bash> | ||
+ | git filter-branch --msg-filter ' | ||
+ | sed -e "/ | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | ===== See Also ===== | ||
+ | * [[creating_and_applying_patch_files]] |