Here a simple snippet to merge a local branch excluding a file.

This is case “myfile.txt”

git merge --no-ff --no-commit <merge-branch>
git reset HEAD myfile.txt
git checkout -- myfile.txt
git commit -m "merged <merge-branch>"
Categories: Bash

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.