Skip to content

Commit

Permalink
added Code to prompt user if he wants to fetch repo before pruning
Browse files Browse the repository at this point in the history
  • Loading branch information
prabodhmeshram committed Dec 7, 2017
1 parent 302d9cb commit e4f49df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/git-prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

#Script to prune / delete the local git script

# Check if needed to fetch before prooning

read -p "Do you wish to perform git fetch ? (Y/N) " yn

if [ $yn = "Y" ]; then
git fetch -p
fi

remote_branches_string=$(git for-each-ref refs/remotes/origin | cut -d/ -f4)

remote_branches=(${remote_branches_string// /})
Expand Down

0 comments on commit e4f49df

Please sign in to comment.