This script provides options to view and manage Git branches based on the author's name. It allows you to view branches created by all/any author or view and delete branches created by that author.
To run this script, you need to have Git Bash installed on your machine.
- Copy the .sh file to the location of the git repository.
- Open the Git Bash terminal from the context menu and Run the script using the below command.
./GitBranchCleanup.sh
- Enter the author's name when prompted ( This name is compared case-insensitively and uses a partial match (i.e., checking if the input name contains the author's name ) ). ( can input '*' for displaying the branches for all users).
- Choose an option (if the user inputs other characters then *):
- View Branches: Display branches created by the specified author.
- View and Delete Branches: Display and delete branches created by the specified author.
- Quit: Exit the script.
Note: Deleting branches is irreversible. Use with caution.
- Ensure you have permission to delete branches before using the "View and Delete Branches" option.
- Always review the branches to be deleted before confirming.