27 October 2012

Eclipse Github Setup

Download and install GIT for Windows (http://git-scm.com/downloads)

Set up system environment variables GIT_SSH pointing to ssh binaries (usually  C:\Program Files\Git\bin\ssh.exe) and user account environment variables HOME = %USERPROFILE%

In Eclipse, install EGit and GitHub Mylyn Connector.

In Eclipse, create new ssh key (Windows->Preferences->SSH2) and upload public key (*.pub) to Github. Make sure the Eclipse variable ssh2 home is set to where you save the created key. Usually found in Windows->Preferences->SSH2.

In Eclipse, create new project. Right click project and choose Team->Share->Git. Then Team->Add index. Then Team->Commit. This will save it in your local git repository.

In Github create repository and note its HTTP and/or SSH URL. Usually its https://github.com/[username]/[reponame].git or ssh://git@github.com:[username]/[reponame].git

In Eclipse, right click project and select Team->Remote->Push. When SSH is use, username=git password is emtpy. When HTTPS is use, enter your Githug username and password and select "Store in Secure Store"