Skip to content

Instantly share code, notes, and snippets.

@ironbyte
Created February 14, 2021 14:43
Show Gist options
  • Save ironbyte/a5579698db56ae852b376676d26e4459 to your computer and use it in GitHub Desktop.
Save ironbyte/a5579698db56ae852b376676d26e4459 to your computer and use it in GitHub Desktop.
Backup a local GIT repository
#!/bin/sh
set -e
REPOSITORY_NAME=$(basename `git rev-parse --show-toplevel`)
BUNDLE_FILENAME=${REPOSITORY_NAME}_`date +%d-%m-%Y""%H%M_%S`.git.bundle
git bundle create $BUNDLE_FILENAME develop master production
@ironbyte
Copy link
Author

Restore a GIT repository backed up previously with git bundle tool:

  • Run git clone -b <default_branch_name> <bundle_name>.bundle <new_directory_name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment