This is a SAMPLE TESTING MESSAGE sent through Cell Broadcasting System by Department of Telecommunication

Image
  This is a SAMPLE TESTING MESSAGE sent through Cell Broadcasting System by Department of Telecommunication, Government of India. Please ignore this message as no action is required from your end. This message has been sent to test Pan-India Emergency Alert System being implemented by National Disaster Management Authority. It aims to enhance public safety and provide timely alerts during emergencies. Timestamp: 12-10-2023 12:13 PM 21

Delete all branches except master or main branch


















To delete all branches in your Git repository except master, simply issue the following command:

$ git branch | grep -v "master" | xargs git branch -D

If you want to delete branches such as master-prod, master-test or master-ui, you can adjust the RegEx used by the grep as follows:

$ git branch | grep -v " master$" | xargs git branch -D



Remove all Git branches but main
=======
To delete all branches in Git except main, simply replace the grep for master with a grep for main:

$ git branch | grep -v "main" | xargs git branch -D
$ git branch | grep -v " main$" | xargs git branch -D

Comments

Popular posts from this blog

Google doodle celebrates India Republic Day

This is a SAMPLE TESTING MESSAGE sent through Cell Broadcasting System by Department of Telecommunication

Shell script to check domain expiry date and send alerts to Slack on Ubuntu