Skip to content
Davide Gatti edited this page Nov 9, 2016 · 2 revisions

Welcome to the code-snippets wiki!

Merge two branches in git with selective changes

git merge --no-ff --no-commit changed    # Merge in 'changed' but don't commit
git reset <path/to/your/file>            # Reset the stage state but not file
git add -i <path/to/your/file>           # Start adding in interactive mode
git commit                               # Finally commit the merge with only
                                         # the bits you chose to stage.
Clone this wiki locally