[TYPO3-core] Git: how to solve divergence?

Peter Niederlag typo3-list at niekom.de
Mon May 16 11:40:17 CEST 2011


Am 16.05.2011 11:27, schrieb Fabien Udriot:
>>> There's at least one situation with Git where I'm still totally baffled
>>> as to what I should do:
>>> I mistakenly applied a patch to a local branch tracking a remote branch,
>>> using the cherry-pick command provided by Gerrit. Now I don't know how
>>> to get rid of it.
>>> "git status" tells me the following:
>>> # On branch TYPO3_4-5
>>> # Your branch and 'origin/TYPO3_4-5' have diverged,
>>> # and have 1 and 11 different commit(s) each, respectively.
>>> #
>>> nothing to commit (working directory clean)
>>> How do I now drop the local change and find myself again on the remote
>>> HEAD?
> git reset --hard

will drop(!) your local commit. Make sure it is a commit you don't need 
anymore beforehand!

> git clean -f (to delete unwanted file that has been added with the
> cherry pick)

Will wipe any obsolete/unknown files.

Now you still miss the "11 commits" from 'origin/TYPO3_4-5', you can get 
them as usual either by 'git pull' or 'git merge'.

Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *

More information about the TYPO3-team-core mailing list