Egit working directory vs. projects in Eclipse

I’m a long time Eclipse user but new to Git/Egit. Recently I’ve been trying to use Egit because I want to use GitHub to collaborate with a number of projects. The projects I want to work on are not Eclipse-specific projects but I’d still like to set up a workflow so that I can work on them in Eclipse.

It seems that there are a number of things that need to fit together:

  • What does the option “Auto share projects located in git repository” of EGit mean?
  • Team Synchronizing Perspective for Intellij?
  • When pushing to remote Git repo using EGit in Eclipse, what should I choose?
  • Restore deleted file directly from Eclipse local history
  • Apache Connection Refused when running Docker-client Java API
  • Can I use git in local area network?
    1. The remote repository (on GitHub)
    2. The local repository (somewhere on my filesystem)
    3. The Git working directory
    4. The Eclipse project that I want to work in (including stuff outside the source tree like Eclipse project files, Maven config, build folders etc.)

    How do these relate to each other and what should be my workflow?

    In particular:

    • Do I actually need a local repository or can I just work directly with the remote repository (like with SVN)?
    • Can the Git working directory also be the Eclipse project? Or is this a bad idea?
    • What should my workflow of push/pull/fetch etc. normally be?
    • If I use Maven for dependency management in the Eclipse project, but don’t want all the Maven-specific stuff to get committed to SCM, can this work?

    Guess I’m loking for some sound advice from someone who’s successfully made this work!

  • Git's “Bash.exe” vs “Git Bash.vbs”
  • git: automatically run bash script ON THE SERVER after any client pushes
  • Can't merge feature bookmark into master bookmark in mercurial
  • git: cleanup or delete commit to cleanup the commit history
  • While git cloning, Can we know if it does not contain any system files like exe, dll etc?
  • git mingw32 and long path/file names under windows
  • One Solution collect form web for “Egit working directory vs. projects in Eclipse”

    Do I actually need a local repository or can I just work directly with the remote repository (like with SVN)?

    Git is all about working on a local repository and pushing elsewhere when necessary.

    Can the Git working directory also be the Eclipse project? Or is this a bad idea?

    If it lines up this way, then yes. This is how I’ve managed my projects.

    What should my workflow of push/pull/fetch etc. normally be?

    You push when you feel you have made enough commits (sometimes only 1) that are worth pushing. You pull when you want to work with changes that other people have pushed.

    See gitworkflows for the official doc on different types of workflows.

    If I use Maven for dependency management in the Eclipse project, but don’t want all the Maven-specific stuff to get committed to SCM, can this work?

    Usually you just commit the pom.xml. Anything else is a user specific setting. Although, if I clone your repository and can’t do a “mvn compile”, then there’s something wrong.

    Git Baby is a git and github fan, let's start git clone.