[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: German update in three patches
From: |
Johannes Schindelin |
Subject: |
Re: German update in three patches |
Date: |
Sun, 14 Jan 2007 13:32:06 +0100 (CET) |
Hi,
On Sat, 13 Jan 2007, Till Rettig wrote:
> I always get patch files from older patches that are definitely not actual
> anymore -- can I somehow remove them myself? You see it by the number of the
> current files: there are obviously six (older) changes in my git that are not
> applied to the master git. But it doesn't make sense to apply them anymore
> because they are outdated.
There are several ways to handle that. In my order of preference, the
two (IMHO) best ways:
- if you _know_ that the patches will apply cleanly against the upstream,
and you _know_ you want to submit three patches, say
$ git format-patch HEAD~3
- if you don't know if the patches apply cleanly, you can start a new
branch, cherry-picking your way through the commits you want to save.
For example, if you want to save the commits myweb~4, myweb~2 and myweb,
do this:
# start a new branch, called "startanew", branching from "web/master"
$ git checkout -b startanew web/master
# pick the three commits
$ git cherry-pick myweb~4
$ git cherry-pick myweb~2
$ git cherry-pick myweb
To throw away _all_ your previous work in myweb, and _only_ retain these
three commits, do
# go back to the branch "myweb"
$ git checkout myweb
# replace the _complete_ history of the current branch by that of "startanew"
$ git reset --hard startanew
# delete the branch "startanew"
$ git branch -d startanew
If you want to retain just the last <n> commits, you might want to play
with git-rebase (better read the documentation for that, since I am
uncomfortable with that command).
Hth,
Dscho