A simple shell script to clone and bundle all the branches from a remote repository of git.
I have a requirement where all of our git repos has to be backed up with all the branches. The simplest way I found is to pass the url and the project name to clone the repository and bundle the repo with all the branhces.
$ ./bundler.sh
- Reads the remote repo url and the desired project folder name.
- Creates a bundles folder if not exists.
- Clones the repo into the desired project folder.
- Checkout all the remote branches. This is important for backing up all the remote branches.
- Creates a bundle of repo under bundles folder outside your project.