Skip to content

Instantly share code, notes, and snippets.

@jmlavoier
Last active July 5, 2017 14:40
Show Gist options
  • Select an option

  • Save jmlavoier/dd62ce835333bfb66eb17d87c0fbd26a to your computer and use it in GitHub Desktop.

Select an option

Save jmlavoier/dd62ce835333bfb66eb17d87c0fbd26a to your computer and use it in GitHub Desktop.
bash function to get all repositories branches
function get_branches {
#The environment path
ENV="~/Sites/env"
#The repositories inside the ENV
envb=$(eval "cd $ENV" && git rev-parse --abbrev-ref HEAD)
uibr=$(eval "cd $ENV/ui" && git rev-parse --abbrev-ref HEAD)
appb=$(eval "cd $ENV/app" && git rev-parse --abbrev-ref HEAD)
#Colors
C1="\033[0;32m"
C2="\033[0;36m"
NC="\033[0m"
printf "${C1}[ENV] ${C2}$envb\n"
printf "${C1}[UI] ${C2}$uibr\n"
printf "${C1}[APP] ${C2}$appb\n${NC}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment