# Replace REMOTE_NAME with your remote name (e.g. origin) | |
git branch -r | grep REMOTE_NAME/ | grep -v 'master$' | grep -v HEAD| cut -d/ -f2 | while read line; do git push REMOTE_NAME :$line; done; |
This comment has been minimized.
This comment has been minimized.
may replace |
This comment has been minimized.
This comment has been minimized.
in MacOS, use For copy-pasters: REMOTE_NAME=xxxxx
git branch -r | grep "${REMOTE_NAME}/" | grep -v 'master$' | grep -v HEAD | sed -E "s/^[[:space:]]*${REMOTE_NAME}\///g" | while read line; do git push $REMOTE_NAME :heads/$line; done; |
This comment has been minimized.
This comment has been minimized.
Just use -f2- instead of just -f2 to fix the branches with / in them. |
This comment has been minimized.
This comment has been minimized.
Hmm... but git push accepts many branches at the same time (e.g.
|
This comment has been minimized.
This comment has been minimized.
Perfect idea. Save a lot of work. |
This comment has been minimized.
This comment has been minimized.
Might want to try |
This comment has been minimized.
This comment has been minimized.
@leoapost This command does not work for branches with
|
This comment has been minimized.
This comment has been minimized.
Works gr8, thanks 4 sharing. |
This comment has been minimized.
This comment has been minimized.
Sweeeeet, thanks for sharing! |
This comment has been minimized.
This comment has been minimized.
This is great! Thank you for sharing! |
This comment has been minimized.
This comment has been minimized.
Thanks for sharing |
This comment has been minimized.
This comment has been minimized.
Thanks to the OP and others who added additional info. Very helpful! |
This comment has been minimized.
This is a life saver! Sweet!!