For example, to avoid creating conflicts in dist/, replace <directory-to-ignore-changes-in> with dist
dist/
<directory-to-ignore-changes-in>
dist
git checkout <branch-to-change> git merge --no-commit --no-ff <branch-to-merge> git reset -- <directory-to-ignore-changes-in> git commit