In the case that a a repository has a number of branches: How does one simply update a file across all the branches.
In this case it\'s a bashrc like file that specif
To extend fork0's comment, you need to combine:
git checkout --
, from git checkout man page)Ie:
#!/bin/bash
branches=()
eval "$(git for-each-ref --shell --format='branches+=(%(refname))' refs/heads/)"
for branch in "${branches[@]}"; do
if [[ "${branch}" != "master" ]]; then
git checkout ${branch}
git checkout master -- yourFile
fi
done
(This is be adapted to your case, since here it always checkout the file from the master
branch.)