Tuesday, 13 August 2013

Explain the -m --mainline --parent-number options for git

Explain the -m --mainline --parent-number options for git

Consider you have 2 branches: branch 'master' and branch
'release/octobrus'. 'release/octobrus' was split off of 'master' a few
weeks back and some commits were added to 'master' and some to
'release/octobrus'.
In error, while working in 'release/obtobrus' I pull and rebase master's
changes in commit hash 'a12345'. Then I push to 'origin elease/octobrus'
The solution was to make sure I'm working in 'release/octobrus' and then
git revert -m 2 a123445. The problem is, why is '-m 2' the correct
mainline?
Can anyone explain what the option for git revert '-m' or '--mainline
parent number' means in context?

No comments:

Post a Comment