1 2 3 4 5 6 7 8 |
for name in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin); do [ "$name" = origin/HEAD ] && continue branch=${name#origin/} git checkout $branch cp /<gitignore path>/.gitignore ./ git add .gitignore git commit -m 'adding gitignore' done |