Reference : http://www.thinkplexx.com/learn/howto/scm/git/import-or-clone-remote-git-gitorious-repository-using-eclipse-egit
I first had problems, how simple “git clone” can be done using Eclipse Egit. After it worked I decided to write a small how-to.
Basically, I have a remote repository in Gitorious and want it in Eclipse.
Works for:
![[v]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0KAQOhkdruRBRAPC7Cd0_IODkS0trWwJ9lItWJUgMrrFp9ejjCi3JYSCpDMoInrMW6I6wsCVQDdCg4ntdh_00eYLMqgzsFqyHeHAK6A-l8AhTGYflPDvZcLRInEEi-QqqYXdKh0tl1vlto7S5E8H02Q=s0-d)
Ubuntu 9.10
![[v]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0KAQOhkdruRBRAPC7Cd0_IODkS0trWwJ9lItWJUgMrrFp9ejjCi3JYSCpDMoInrMW6I6wsCVQDdCg4ntdh_00eYLMqgzsFqyHeHAK6A-l8AhTGYflPDvZcLRInEEi-QqqYXdKh0tl1vlto7S5E8H02Q=s0-d)
Git
![[v]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0KAQOhkdruRBRAPC7Cd0_IODkS0trWwJ9lItWJUgMrrFp9ejjCi3JYSCpDMoInrMW6I6wsCVQDdCg4ntdh_00eYLMqgzsFqyHeHAK6A-l8AhTGYflPDvZcLRInEEi-QqqYXdKh0tl1vlto7S5E8H02Q=s0-d)
Eclipse Helios
![[v]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0KAQOhkdruRBRAPC7Cd0_IODkS0trWwJ9lItWJUgMrrFp9ejjCi3JYSCpDMoInrMW6I6wsCVQDdCg4ntdh_00eYLMqgzsFqyHeHAK6A-l8AhTGYflPDvZcLRInEEi-QqqYXdKh0tl1vlto7S5E8H02Q=s0-d)
EGit
Should also work for:
![[v]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0KAQOhkdruRBRAPC7Cd0_IODkS0trWwJ9lItWJUgMrrFp9ejjCi3JYSCpDMoInrMW6I6wsCVQDdCg4ntdh_00eYLMqgzsFqyHeHAK6A-l8AhTGYflPDvZcLRInEEi-QqqYXdKh0tl1vlto7S5E8H02Q=s0-d)
most Linux distos
![[v]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_v0KAQOhkdruRBRAPC7Cd0_IODkS0trWwJ9lItWJUgMrrFp9ejjCi3JYSCpDMoInrMW6I6wsCVQDdCg4ntdh_00eYLMqgzsFqyHeHAK6A-l8AhTGYflPDvZcLRInEEi-QqqYXdKh0tl1vlto7S5E8H02Q=s0-d)
any Eclipse with can EGit
Get the Uri and protocolsGitorious shows the proper Uri. Select your project in Gitorious in web browser and then go to your Repository.
You see “Clone & push urls”
(1).
We will need this info:
![[+]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uID-0fcULz78HUjaC_2Pzl7Nhh86yEriKeVzy6_yDp7eJKqggcNocKIj0sOLqDlFw5_zGfn0RjWdmk1RNn3nHnpsRF45Ve6Ytb1e0La6k7Awp471gd5ErFCtQbr0MFdsWiEApl2mwkocKXC3EfufL09Q1z=s0-d)
which protocols are enabled
(2) (default is “ssh”)
![[+]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uID-0fcULz78HUjaC_2Pzl7Nhh86yEriKeVzy6_yDp7eJKqggcNocKIj0sOLqDlFw5_zGfn0RjWdmk1RNn3nHnpsRF45Ve6Ytb1e0La6k7Awp471gd5ErFCtQbr0MFdsWiEApl2mwkocKXC3EfufL09Q1z=s0-d)
path for “git clone”
(3) (copy it)
You can learn more about basic operations on particular repository using ” ? ” in repo view
(4).
EGit importIn Eclipse: [ Import -> Git -> [Clone BUTTON] ]
Fill in data in “Clone Git Repository” dialog
![[star]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uDsC0P8QeDG-f8u1wh78uMjVlKbB25FCeth4jDPEQrjmurD_VvsEcZVSKwHSEs-dP3R9ae6ES5t_APxgpLlq39OBWA3rNshe7WmFf0fGQjK7fWdPjBp3AtexBcmYNyuSq-3qDMRg2ZRb8LU9DhotaFW4Z9=s0-d)
Copy the path for “git clone” (copied in step 1) into “URI” field. Now, git complains about “Host not supported on file protocol”.
![[i]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vVa5mACUa3tGDrwDi3nj74mHcJ3ifuce9o65g7SvmdYlVGmlDCNWqaQiss-VCVMjik1SFtkvWVFVyOML8LsEbKDXs8PCji3rkzH-H-YaCazFlTqP80ewddJhFq9goDK65yyS3XkU8-JkYLpGLqkgKXf5Yu=s0-d)
On some systems just pasting the right url and setting the protocol seems to be enough. On others, manual steps are needed as well.
![[star]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uDsC0P8QeDG-f8u1wh78uMjVlKbB25FCeth4jDPEQrjmurD_VvsEcZVSKwHSEs-dP3R9ae6ES5t_APxgpLlq39OBWA3rNshe7WmFf0fGQjK7fWdPjBp3AtexBcmYNyuSq-3qDMRg2ZRb8LU9DhotaFW4Z9=s0-d)
Set the protocol drop down list to be
ssh:// if that is the protocol your gitorious shows. Try the [ Next >] button.
If it works, go to the step with entering the password. Skip the manual steps described next.
Prefix URI with ssh:// . That changes the protocol.
In host, make sure only host Url is shown, not host.name:project-name (for some reason my Gui always sets it this way). Copy project-name to the ‘repository-path’ input field instead
![[star]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uDsC0P8QeDG-f8u1wh78uMjVlKbB25FCeth4jDPEQrjmurD_VvsEcZVSKwHSEs-dP3R9ae6ES5t_APxgpLlq39OBWA3rNshe7WmFf0fGQjK7fWdPjBp3AtexBcmYNyuSq-3qDMRg2ZRb8LU9DhotaFW4Z9=s0-d)
Do “Next >”. You will be asked for the pass phrase for your
SSH “.rsa” or “.dsa” key.
Important
Here Gitorious expects that you have your private key from the key pair locally. The public key must have been previously stored in the Gitorious.
![[star]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_uDsC0P8QeDG-f8u1wh78uMjVlKbB25FCeth4jDPEQrjmurD_VvsEcZVSKwHSEs-dP3R9ae6ES5t_APxgpLlq39OBWA3rNshe7WmFf0fGQjK7fWdPjBp3AtexBcmYNyuSq-3qDMRg2ZRb8LU9DhotaFW4Z9=s0-d)
Enter password for your local private key, if any.
Now, cloning with Git should work.
That’s it, have fun!
No comments:
Post a Comment