Display correct name in a teamwork

Since your computer’s username and domain are not always associate with your GitHub settings, you may experience unrecognized committer problem while working with a team. It’s not a critical problem in most cases, but annoying. Here is how you can customize your name in an Eclipse environment with GitHub.

Default @author

Add -Duser.name=Firstname Lastname at the bottom of eclipse.ini file, which can be found in the Eclipse directory.

Default Author & Committer

Go to Eclipse menu -> Preferences -> Team -> Git -> Configuration. Open configuration and add:

name = Firstname Lastname
email = Your email address

Or, you can add entries:

user.name = Firstname Lastname
user.email = Your email address

If your email address matches the email address you registered on GitHub, it can be recognized.

Import modules within a github repository

Instead of creating bunch of repositories for different modules of one project on github, you can make one repository for the entire project (which makes more sense), and import each module separately in your eclipse.
Note: unlike IntelliJ, in eclipse terminology, module is called project. I’m going to switch back to eclipse terminology in the following part.

You need 9 steps to do it:

  1. Create a repo on github
  2. Install EGit in eclipse
  3. Import the repo on github into eclipse with a Local Destination
  4. Eclipse will download files in this repo, but it’s just a normal folder, not a project
  5. Create new local module with eclipse (so the project can be configured by eclipse)
  6. In the file system, copy local module to the repo folder
  7. Refresh the repo folder in eclipse, and do a commit
  8. Delete the local project (the original one) in eclipse
  9. Import the local repo, and now you should be able to choose the project built earlier as an existing Eclipse project