K L
K L

Reputation: 1371

Am I using Git in Eclipse the right way?

Using Eclipse Juno on Windows. After struggling with Git a little bit, this is what I've come up with:

Note - at this point I want to be able to push to GitHub.

  1. Set up a project
  2. Put it under version control
  3. Create a remote which is my GitHub repository
  4. Push to the remote

However, I want to make it such that whenever I commit in Eclipse, it updates my GitHub repository automatically. Currently it only updates my local folders. Am I making sense here? How should I do this?

Also, why is it bad practice to use Git in the workspace of Eclipse? My directory structure looks like this on my local computer:

Thanks!

PS If this sounds really noob, yeah, I'm pretty new at version control but I figured I got to start from somewhere. Looked at all the tutorials online too, and this is what I came up with.

Upvotes: 3

Views: 955

Answers (1)

ddewaele
ddewaele

Reputation: 22603

Auto pushing changes to the remote.

With the latest version of the eGit plugin for Eclipse, there's a checkbox that will push every commit to the configured remote.

People coming from CVS/SVN typically auto-push to the remote. However, in a distributed version control system like Git I would advise against it. Especially in larger teams you don't necessarily want to push each commit to the remote for everyone to see.

Directory structure

There's a write-up on why Eclipse advises against creating the Repository within the Eclipse workspace.

Upvotes: 2

Related Questions