Migrating the Git Repository to another server

Updated . Posted . Visible to the public.

Remote Git (only once)

  • create Team account on git host
  • create PRIVATE repository on git host
  • $ git fetch
  • using git checkout create a local copy for every remote branch: $ git checkout branch1, $ git checkout branch2 etc. (you may use the attached git-checkouter.rb script for this)
  • $ git remote add new-origin [REPO-URL]
  • $ git push -u new-origin --all
  • $ git push -u new-origin --tags
  • $ git remote remove origin
  • $ git remote rename new-origin origin

Local Git (for everyone)

  • create user account on the new git host
  • add your public SSH key to the host (somewhere in Settings)
  • get added to the team by the admin
  • in .git/config update the remotes (probably just one "origin") to the new repository URL

Deployment (only once)

  • on all servers, remove the cached-copy in the shared directory
  • in the app code: in config/deploy.rb update the repository URL
  • on all web-servers connect once to the git host, to accept the authenticity of the host, e.g. $ ssh github.com
Philipp Antar
Last edit
Philipp Antar
Attachments
Posted by Philipp Antar to Distribusion IT (2015-01-14 11:36)