Example:
master
, develop
develop
branch and want to ignore it while mergingCode:
git config --global merge.ours.driver true
git checkout master
echo "path/file_to_ignore merge=ours" >> .gitattributes
git merge develop
You can also ignore files with same extension
for example all files with .txt
extension:
echo "*.txt merge=ours" >> .gitattributes