Pergunta

It's kind of like I want to cherry pick all commits from the branch except for one, but I'd like to do that in one command...

• We cut a release, which creates a branch

• The release changes the version number in all our poms, on the branch to one number, and on master to a different number

• I've committed a number of other changes to the branch and want to copy those changes back onto master

• I've merged the branch back into master, which brought the code changes but also the version number changes, creating conflicts in every pom

Is there any easy way for me to revert all the pom files to their pre-merge content and then commit that as the result of the merge?

Foi útil?

Solução

Here's what I'd suggest doing. First, do a regular merge but don't commit it:

git checkout master
git merge --no-commit <branch>

then, revert all of the pom files:

for file in $(find . -name 'pom.xml'); do git checkout HEAD "$file"; done

then you should be able to commit the final result:

git commit
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top