I would like to search git branches for any modified files in common between mine and all others, as a method of early conflict detection. Is there a method that git would allow me to do this that I'm overlooking (or via shell scripting)?
The method I've thought of for now is, as a post-commit hook:
- Performing a
git diff --name-only master
on the branch I'm in, to determine all the files I'll be searching for in other branches (to generate a list of conflicting branches) - Searching/grep'ing for each file I've obtained (in previous step) in everyone's other remote branches via
git diff --name-only origin/<remote branch> origin/master
on the remote repository - Returning a list of branches that contain one or more of the files that conflict, based on the results of my search/grep.