Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git delete local branches not on remote

git fetch -p && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done
Comment

delete local branches not on remote

git branch -vv | grep ': gone]'|  grep -v "*" | awk '{ print $1; }' | xargs -r git branch -D
Comment

git delete branches not on remote

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

How to Delete Local/Remote Git Branches

$ git branch -a

# *master
# b1
# remote/origin/master
# remote/origin/b1

$ git push origin --delete b1
# [...]
# - [deleted] b1
Comment

How to Delete Local/Remote Git Branches

$ git branch -r | egrep -v -f /dev/fd/0  <(git branch -vv | grep origin) | xargs git branch -d
Comment

How to Delete Local/Remote Git Branches

$ git branch -a

# *master
# b1
# remote/origin/master
# remote/origin/b1

$ git push origin --delete b1
# [...]
# - [deleted] b1
Comment

PREVIOUS NEXT
Code Example
Shell :: The file will have its original line endings in your working directory 
Shell :: centos install lsb_release 
Shell :: vs force restore all packages command line 
Shell :: homebrew restart service 
Shell :: Failed to install the app. Make sure you have the Android development environment set up 
Shell :: centos install vim 
Shell :: install tree in linux 
Shell :: install react 16 
Shell :: zsh compinit: insecure directories, run compaudit for list. 
Shell :: execute bash script from anywhere 
Shell :: un innstall dot net ubuntu 
Shell :: uninstall lightdm 
Shell :: find out which procses is using port linux 
Shell :: how change remote origin git 
Shell :: ip address ubuntu 
Shell :: nginx E: Sub-process /usr/bin/dpkg returned an error code (1) 
Shell :: pip upgrade stramlit 
Shell :: ubuntu dconf editor install 
Shell :: add credentials to git 
Shell :: npm install @reach/router 
Shell :: jupyterlab 
Shell :: ubuntu stop process on port 
Shell :: git config remote.origin.url 
Shell :: get current date talend 
Shell :: Unrecognized command "eject" 
Shell :: enable telnet using cmd 
Shell :: docker compose network not found 
Shell :: install yarn on ec2 instance 
Shell :: heroku cli connect to app 
Shell :: ln phpmyadmin 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =