Backup your git repositories programmatically to BitBucket.
This is a simple and straightforward CLI utility that allows you to backup your git projects to BitBucket.
It is common to be working on public projects on GitHub that you also want another copy of to your BitBucket account. There are a number of use cases that come to mind that might prompt you to start doing this, such as:
- Ensuring you always have a backup in case other collaborates have force push access.
- If you're working with microservices and you want to pull down the latest code from all of the different repositories and have a backup on BitBucket
Without bloating the utility with a ton of required options, the git-backup
depends on certain aspects being present in each of your git repositories.
- Make sure you have an origin remote configured. Branches will be fetched/pulled from this source.
- Make sure that you have a bitbucket remote configured. All branches will be pushed to this source.
# If you dont have your sources configured, you can do something along these lines:
git remote add origin [email protected]:oshalygin/git-backup.git
git remote add bitbucket https://[email protected]/oshalygin/git-backup.git
go get -u github.com/oshalygin/git-backup
Usage of git-backup:
--path string
The path locations where every directory will be iterated through and backed up.
# Call the utility at the specified path with the
# appropriate command line arguments.
git-backup --path=../projects
# Or use the shorthand
git-backup . # This will run the utility and iterate over all of the folders in the current path
path: The path that contains all of the git projects that are to be backed up.
The utility depends on the requirements, in the future this will be expanded into CLI options.