I've got a challenge regarding GIT. I'm trying add and checkout specific files when a merge fails. I already created a post-merge hook which checks if there are files with UU-flag (Both modified) but the post-merge hook isn't invoked when a merge fails.
### Are any Sass files canged and added?
if git status -s | grep '^UU.\+styles\.css$'
then
git add skin/frontend/responsive/*/styles.css -f
git checkout --theirs skin/frontend/responsive/*/styles.css
git commit -m 'Added and checked out specific css-files from the incoming branch to avoid merging binary files'
else
echo "didnt find conflicted files"
fi
exit 0
I've thoroughly searched for a solution or something but couldn't find a way to automatically check for merge conflicts after a merge fails. The only thing that came close enough was a python-script which fired when a pre-commit is invoked. So, is there a hook which I can use when a merge fails?
Thanks in advance