Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

gitlab stale branches api script

for branch in `git branch -r | grep -v HEAD`; do 
    echo -e `git show --format="%cr %an" $branch | head -n 1` 	$branch; 
  done | 
  grep -e '.. months' -e '[8-9] months' | grep 'origin/' | 
  sed 's/.*origin///' | 
  xargs -n 1 echo git push origin --delete | bash
Source by gitlab.com #
 
PREVIOUS NEXT
Tagged: #gitlab #stale #branches #api #script
ADD COMMENT
Topic
Name
8+2 =