Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git delete all remote branches except master

git branch -r | grep 'origin' | grep -v 'master$' | grep -v HEAD | cut -d/ -f2- | while read line; do git push origin :heads/$line; done;
Comment

remove all branches deleted on remote

# Shorthand for deleting localy all branches already deleted on remote
# set this alias in git.config
git config --global alias.gone "! git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == "[gone]" {print $1}' | xargs -r git branch -D"
# then run
git gone
Comment

git delete all remote branch except master

git branch -r | grep 'origin' | grep -v 'master$' | grep -v 'develop$' | grep -v HEAD | cut -d/ -f2- | while read line; do git push origin :heads/$line; done;
Comment

PREVIOUS NEXT
Code Example
Shell :: webpack/config/html 
Shell :: download google drive file linux 
Shell :: linux keyboard layout cli 
Shell :: linux set environment variable 
Shell :: how to get visual studio code on a raspberry pi 4 
Shell :: oh my zsh 
Shell :: link to folder ubuntu 
Shell :: netspeed ubuntu 20.04 
Shell :: powershell or command prompt 
Shell :: how to run a .sh file 
Shell :: wget mac robot 
Shell :: rename branch name in git 
Shell :: Git command to Change Your Committer Name & Email per repository 
Shell :: git diff files only 
Shell :: nuxt 3 install 
Shell :: how to create new branch in git 
Shell :: powershell get-verb sorted by verb 
Shell :: install rvm for ruby 
Shell :: git pull with username and password linux 
Shell :: npm install 
Shell :: tree command levels 
Shell :: vscode publish to github organisation 
Shell :: visual studio export installed nuget pacjkages 
Shell :: pip install influxdb 
Shell :: how to make makefile 
Shell :: git basic commands 
Shell :: firebase realtime database delete all data 
Shell :: installing flutter_native_splash 
Shell :: deploy docker to heroku 
Shell :: run crontab locally in windows 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =