Skip to content

Instantly share code, notes, and snippets.

@sebdah
Last active July 6, 2021 08:48
Show Gist options
  • Save sebdah/129fb35951671495a07a6e33dac51f29 to your computer and use it in GitHub Desktop.
Save sebdah/129fb35951671495a07a6e33dac51f29 to your computer and use it in GitHub Desktop.
# list all current branch names
function gBa
set -lx root ~/go/src/github.com/saltside
for r in (ls -1 $root)
if ! test -d $root/$r
continue
end
cd $root/$r
set_color blue;
echo -ne "$r"
set_color normal;
set -lx branch (git branch --show-current)
echo -ne " ($branch)\n"
end
end
# gLa is pulling all repositories
function gLa
set -lx root ~/go/src/github.com/saltside
for r in (ls -1 $root)
if ! test -d $root/$r
continue
end
cd $root/$r
set_color blue;
echo -ne "Pulling $r.."
set_color normal;
git pull > /dev/null
if test $status -gt 0
echo -e " ❌"
else
set -lx branch (git branch --show-current)
echo -ne " ($branch)"
set_color green;
echo -e " ✅"
end
end
set_color normal;
end
# gSua is updating submodules for all repositories
function gSua
set -lx root ~/go/src/github.com/saltside
for r in (ls -1 $root)
if ! test -d $root/$r
continue
end
cd $root/$r
set_color blue;
echo -ne "Updating submodules $r.."
set_color normal;
git submodule update --init --recursive &> /dev/null
if test $status -gt 0
echo -e " ❌"
else
set_color green;
echo -e " ✅"
end
end
set_color normal;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment