Re: My GIT Day
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 20, 2005, 11:02 UTC
- Message-ID
- <Pine.LNX.4.63.0508201254040.32350@wgmdd8.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7voe7tqpae.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 19 Aug 2005, Junio C Hamano wrote:
Show 17 quoted lines
> $ git checkout pu > $ git reset master > > This checks out the head of "pu" branch, and then resets the > index file to match "master" and updates .git/refs/heads/pu. > > What it does _not_ do is to update my working tree to match the > index file. Linus recommends to do "git checkout -f" at this > point, but I typically do this instead: > > $ git diff -R -p | git apply > > Note. This is an embarrassingly expensive way; the only thing > it buys me over "git checkout -f" is that it removes the files > that were introduced in "pu" branch that did not exist in the > "master" head. I have to come up with a not so expensive way to > do this.
How about this?
$ git reset master
$ rm -i $(git-diff-tree ORIG_HEAD HEAD | grep "^.\{97\}D" | cut -c 100-)
$ git checkout -fCiao, Dscho