Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 31 Current »

 

To migrate a repository from a git based version control (like github, Bitbucket , code.seas.harvard.edu , etc ) to Harvard Enterprise GitHub

  1. Create a repository in code.harvard.edu 
  2. Use git commands to move the repository contents. 

Example: Suppose we want to migrate aws_devops (git@bitbucket.org:harvardseas_sysops/aws_devops.git) from Bitbucket to Harvard Enterprise GitHub. 

Create new repository "aws_devops" in code.harvard.edu using the UI or API

   Using the website

   Or with API calls

Note that token and API calls are useful if you want to automate things or move multiple repositories at once.

Migrate the repository

  • Clone the old repository 

  • Remove the old repository remote URL

  • Add the new remote repository URL, 

  • push to the remote repository.

git clone --mirror git@bitbucket.org:harvardseas_sysops/aws_devops.git
cd aws_devops
git remote remove origin
git remote add origin git@code.harvard.edu:SEAS/aws_devops.git
git push origin --mirror
  • The "–mirror" option is to map all the branches and tags.

  • You need to setup SSH keys to the push to a repository in code.harvard.edu

Remove your token

if you created a token above, then delete it

go to : https://code.harvard.edu/settings/tokens then delete it.

 

  • No labels