(2010-10-13) Migrating Git Project From Github To Sourcerepo

Need to move a Git repository from the contractor's GitHub to a new SourceRepo git repository. (I'm new to project, so have no code locally yet.)

  • create empty repository: git init

  • connect to SourceRepo repository: git remote add origin....

  • clone: git clone git@github.com:(userid)/(repository).git

    • hmm getting rejected.

    • doh! forgot to do SSH Key Gen first.

    • try again - yes userid should be the current owner of the repository, not me.

      • it asks for my SSH key passphrase (MacOs X popup actually asks for "password"; it also lets me add to my Keychain, so I won't have to re-type it again).

      • success, it gives me everything in my local directory.

  • do git add * and git commit

 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 160000 ***
  • (adding this note after hitting issues - does it sound like nothing's actually been committed?)

  • add my Public Key to my SourceRepo account.

  • do git push origin master

Bill-Seitzs-MacBook:code billseitz$ git push origin master
The authenticity of host '***.sourcerepo.com (174.36.255.141)' can't be established.
RSA key fingerprint is 34:41:21:8a:1d:3f:86:9f:25:c4:47:e9:59:6d:da:dc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '***.sourcerepo.com,174.36.255.141' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
  • support thought there was a problem with my Public Key. So I removed the old one and re-added, using the same copy/paste procedure I had gone through earlier with GitHub. Same result. Re-emailed them.

  • ah, problem was that my Project User ID was my email address (thus had a @ in it) - that was causing some problem. Support changed the ID (I had to go back in and turn on read/write access.) Now seems to work:

$ git push origin master
Initialized empty Git repository in /home/git/repositories/***/***.git/
Counting objects: 2, done.
Writing objects: 100% (2/2), 242 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
To git@***.sourcerepo.***/***.git
* [new branch]      master -> master
  • go back into SourceRepo under Master account, now it gives me link to install RedMine. Yes it works. Redmine users are separate from your project users and must be managed from within Redmine and not the SourceRepo control panel.

  • hmm, looks like that Git push didn't actually send anything upstream. Was there another step I missed?

  • I tried doing git init to start over (but still had the files downloaded via clone, so maybe I didn't redo enough), then git add . (note used period this time instead of asterisk), then git commit. But still when did git push got Everything up-to-date which doesn't seem helpful.

  • hmm, wondering if I have too many directories, having the /code/ directory with its own /.git/ subdirectory, then also /code/(repository)/ with its /.git/ subdirectory. Further support:

Bill-Seitzs-MacBook:code billseitz$ git ls-files
misnomer
Bill-Seitzs-MacBook:code billseitz$ cd misnomer
Bill-Seitzs-MacBook:misnomer billseitz$ git ls-files
.gitignore
.gitmodules
(and the other hundreds of files under various subdirectories)

Update: finally pointed at http://help.github.com/moving-a-repo/ which works! (Then you do a git clone from the new repository and you're all set.)


Edited:    |       |    Search Twitter for discussion