1 Commits

Author SHA1 Message Date
0076c210cd add foo 2024-07-06 08:47:58 +02:00
3 changed files with 1 additions and 43 deletions

View File

@@ -1,43 +0,0 @@
#!/usr/bin/env bash
origin=origin
declare -a remotes local
readarray -t remotes < <(git remote)
declare -A aremotes alocal_b
# fetch all remotes
for remote in "${remotes[@]}"; do
aremotes["$remote"]=1
echo doing git fetch -a "$remote"
done
# get local branches
readarray -t local_b < <(git for-each-ref --format='%(refname:short)' refs/heads/)
# build local ref array
for ref in "${local_b[@]}"; do
alocal_b[$ref]=1
done
readarray -t orig_b < <(git for-each-ref --format='%(refname:short)' \
refs/remotes/"$origin"/)
declare -p remotes
#declare -p aremotes
declare -p local_b orig_b
# find-out missing local branches
for remote_b in "${orig_b[@]}"; do
short=${remote_b#"$origin"/};
echo "$remote_b -> $short ${alocal_b[$short]}"
done
#git remote | xargs -n 1 git fetch -a

1
foo Normal file
View File

@@ -0,0 +1 @@
foo