Skip to content

Instantly share code, notes, and snippets.

@brigleb
Last active September 9, 2015 01:03
Show Gist options
  • Save brigleb/da484f02afe74b0da58c to your computer and use it in GitHub Desktop.
Save brigleb/da484f02afe74b0da58c to your computer and use it in GitHub Desktop.
Move a git file from one host to another
#!/bin/bash
# move_git - A script to move a repo from bitbucket to beanstalk
# Assumes you use a ~/Sites folder for these things, and are in it?
# Will leave behind a tarred zipfile of the repository.
# Note: Remember to create the repo in Beanstalk first!
# Usage: move_git.sh repo_name
git clone --mirror git@bitbucket.org:needmoredesigns/$1.git
cd ~/Sites/$1.git
git push --mirror git@needmore.git.beanstalkapp.com:/needmore/$1.git
cd ~/Sites
tar zcf $1.git.tgz $1.git/
rm -rf ~/Sites/$1.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment