Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git delete local branch no longer on remote

git remote prune origin prunes tracking branches not on the remote.

git branch --merged lists branches that have been merged into the current branch.

xargs git branch -d deletes branches listed on standard input.

Be careful deleting branches listed by git branch --merged. The list could include master or other branches you'd prefer not to delete.

To give yourself the opportunity to edit the list before deleting branches, you could do the following in one line:

git branch --merged >/tmp/merged-branches && 
  vi /tmp/merged-branches && xargs git branch -d </tmp/merged-branches
Comment

PREVIOUS NEXT
Code Example
Shell :: installing eslint globally 
Shell :: check if mongodb is installed 
Shell :: completely uninstall apache from ubuntu 
Shell :: git overwrite urlk 
Shell :: how to stop running port in ubuntu 
Shell :: ubuntu bluetooth protocol not available 
Shell :: Unable to resolve dependency tree error when installing npm packages 
Shell :: pip install networkx 
Shell :: how to install steam on ubuntu 
Shell :: vue js version check 
Shell :: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! 
Shell :: clone a conda environment 
Shell :: install adb mac os 
Shell :: ffmpeg convert mov to mp4 
Shell :: ubuntu cleanup systemd journal 
Shell :: how to extract zip file in ubuntu terminal 
Shell :: reverse an array in shell scripting 
Shell :: restart network centos 
Shell :: install laravel ui in laravel 8 
Shell :: code blocks install ubuntu 
Shell :: vim nerdtree always show hidden files 
Shell :: npm installation in mac 
Shell :: linux give all files an extension 
Shell :: run a command x number of times linux 
Shell :: make fish as default shell 
Shell :: docker post installation steps 
Shell :: install cv2 ubuntu 
Shell :: sed remove empty lines 
Shell :: gyp error npm install 
Shell :: docker ls in dockerfile 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =