Files
dotfiles/scripts/shell/job/git-cat-file-for-each-branch.sh

18 lines
359 B
Bash
Executable File

#!/bin/bash
filename=$1
repo_dir=`pwd`
for branch in $(git for-each-ref --format='%(refname)' refs/remotes/origin); do
cmd_out=`git show $branch:$filename`
if [ $? -ne 0 ]; then
cmd_out="[$branch] O arquivo \"$filename\" não existe no branch"
else
echo "[$branch] Arquivo:"
echo "$cmd_out"
fi
printf "\n"
done