0

I just created (and configurated) a GitHub account and now I want to import the sources of my local Git repository into GitHub (the famous "First Commit").

For information the repository of my GitHub account is private.

The aim is to be for the same level between my local repository and the repository of GitHub.

I use Eclipse (Luna 4.4.2 with EGit 3.4.2 - Windows 7) - not command lines for Git (any native Git installed in file system).

Can you indicate me the process to be followed ?

Deenadhayalan Manoharan
  • 5,436
  • 14
  • 30
  • 50
IBACK
  • 39
  • 9

1 Answers1

1

You can duplicate it

cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git

Also (from here):

$ cd your_local_repo
$ git remote add origin git@github.com:USERNAME/REPO_NAME.git
$ git push origin master
Community
  • 1
  • 1
flafoux
  • 2,080
  • 1
  • 12
  • 13
  • I work with EGit (Eclipse) not native Git so the command lines are not available. – IBACK May 28 '15 at 12:03
  • Then do a traditionnal `push` but select your github repo as destination (first page of wizard) – flafoux May 28 '15 at 12:08
  • 1/ Eclipse / General / SSH2 -> generate keys id_dsa + id_rsa -> I uploaded this keys in GitHub 2/ In the Wizard : URI = git@github.com:xxxx/my_project.git, Host=github.com, Repository path=xxxx/my_project.git,port= empty, user=git or username of GitHub account ?, password : password of GitHub account ? which protocol to use (ssh or git) ? – IBACK May 28 '15 at 12:52
  • I try this : URI=ssh://git@github.com/xxxx/my_projet.git, HOST=github.com, Repository Path=xxxx/my_projet.git, PROTOCOL=ssh, USER=git -> i have this error message : ssh://git@github.com:22: org.eclipse.jgit.transport.CredentialItem$StringType:Passphrase for C:\Users\YYYY\.ssh\id_dsa – IBACK May 28 '15 at 13:19
  • I find a solution : in Git Repositories View / create remote and push sources and not Team / Remote / push ! After creating remote, no problem : i can use Team / Remote / push when i commit & push my sources. – IBACK May 29 '15 at 08:45