Hi everyone,
I would like to share how to import Eclipse Project to GitHub using SSH key.
Step 1: Installing EGit in your Eclipse.
- Click the Help option -> Select Eclipse Market Place and Search EGit in Find field .
- Select the EGit -Git integration for Eclipse plugin (ignore Step 1, if EGit is already installed in your eclipse)
Step 2: Generating SSH key.
- Select window -> Preferences -> General -> Network Connections -> SSH2
- Under SSH2 configuration Option Select -> Key Management -> click Generate RSA Key
- RSA Private key will be generated and make sure to copy the RSA key for using it in your GitHub Account .
- Then click Save Private Key button and Apply
- Step 3: Create Local Repository in your Local System for commit.
- Right click on your project and Select Team -> Share Project -> Git
- Config Git dialog box will pop up, In that create a new Repository by clicking Create button and finish.
- Now you can see your project named changed like , YourProjectName [Repositoryname NO-HEAD]
Step 4: Staging the files which you want to push into GitHub Repository.
- Right Click on your Project name -> team -> commit
- you can find your Project and files under Unstaged changes option.
- Select the files or Drag files(which you want to push into GitHub)to the Staged changes option.
- you can give Commit messages under the Commit Message Field . For example , My_FIRST_GitHub_Export .
- then click Commit & Push and ignore the dialog box which will occur after this process.
- Now you can see your project Changed to YourProjectName [Repositoryname master]
Step 5: Create Remote for Push
- Windows -> show view -> other -> Git -> choose Git Repositories
- Your project will shown under Git Repositories Console
- Now select, References -> Remote -> Create Remote
- Remote name : origin and select Configure push and then Ok
Step 6: Configure Push for remote 'origin'
- Select CHANGE button in URL field
- Destination Git Repository dialog box will be open
- Follow Step 7
- Now Paste the SSH URL under Location option
- choose your Protocol as SSH, under connection option and click Finish
- Now Click Save and Push button. (this is your final step and you see your Project is pushed into your GitHub account under the repository which you have created)
Step 7: Create Repository in GitHub
- Go to your GitHub account and select a Create New Repository option
- Now you can see owner and Repository name field
- Give your repository name and click create Repository button.
- Copy the SSH URL using Copy clipboard option.
- once your Repository is created and copied the URL go to your account setting .
- select SSH and GPG keys
- click New SSH key button
- give any name in tittle field and paste the RSA key which you have generated in Step 2 from eclipse.
- click Add SSH key button
........................................................
Written By ,
Ananda Murugan Ilango
College of Engineering Guindy