dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

git-pull-menu (405B)


      1 #!/usr/bin/env bash
      2 if ! command -v git &> /dev/null; then echo "git not found" && exit 1; fi
      3 git fetch --all
      4 if ! git pull --ff-only; then
      5   select action in "Rebase" "Merge"; do
      6     upstream="$(git branch -r | grep -v HEAD | tr -d ' ')"
      7     case $action in
      8       Rebase)
      9         git pull --rebase "$upstream"
     10         break;;
     11       Merge)
     12         git merge "$upstream"
     13         break;;
     14     esac
     15   done
     16 fi