12

I currently use Assembla for my git hosting. I want to move my git repository to github hosting. I have never done this before - what is the process? Obviously, I want to keep all my previous commits/changes, etc...

Thanks.

deruse
  • 2,851
  • 7
  • 40
  • 60
  • Have a look at this [Importing an external Git repository](https://help.github.com/articles/importing-an-external-git-repo) help page on Github. – mrmrf Nov 01 '12 at 07:19

3 Answers3

11

Pull your repository to a local location using git clone.

Then create a new repository on github.com, remove the old remote and add the new remote:

git remote rm "assembla remote name"
git remote add origin git@github.com/your_repo_path
git push -u master
citizen conn
  • 15,300
  • 3
  • 58
  • 80
  • Do you need to do a separate push of tags with `git push --tags`? – intuited Jul 13 '11 at 00:25
  • From github: By default, push will only send the ref you specify. To push a single tag you can simply use `git push REMOTENAME TAGNAME`. To push all tags while pushing another branch, you can use `git push REMOTENAME BRANCHNAME --tags`. – citizen conn Jul 13 '11 at 00:31
8

First, create a new (empty) repository in GitHub - say Test

Next, Clone from Assembla ( if not already, or git pull )

Finally, do the following:

  cd cloned_from_assembla
  git remote rm origin
  git remote add origin git@github.com:user/Test.git
  git push -u origin master

(basically, remove the remote pointing to assembla and create new one to github and push to it. These instructions are same as the one provided to you by GitHub once you create a new repo.)

manojlds
  • 290,304
  • 63
  • 469
  • 417
1

You simply need to add new remote to your existing repository and then you can work on multiple remotes.

How to add new remote?

git remote add <new_name><new url>

and from this point on you can simply do anything on this repo (assuming you have permissions)

git pull <new_name> <branch>
git push <new_name> <branch>

enter image description here

Community
  • 1
  • 1
CodeWizard
  • 128,036
  • 21
  • 144
  • 167