How To Use Eclipse For Coding MsysGit - wnoguchi/msysgit GitHub Wiki

Sure, there are many ways to get started coding on msysGit. While participating a 24h-hackathon, we've discovered a smart way to code on msysGit under Windows, by using Eclipse.

Goals

  • using an IDE - not only a text editor
  • code syntax highlighting (sophisticated and able to recognize scopes)
  • code navigation (clicking with mouse of using keyboard shortcuts)
  • re-factoring (at least rename local variables, etc.)
  • full and robust debugging support using actual C source code files
  • preferred: smart search, not only RegEx ;-)
  • nice to have: able to create build within the IDE

As it turns out, with a little knowledge about Eclipse, we've found everything solved by using Eclipse and a separate MinGW installation. The setup is pretty fast and can be done in less than one hour. If you know other Languages and IDEs, you may miss some features, but this setup solved our needs. Some aspects/goals are not yet solved (wasn't our focus) - so consider this as a starting point ;-)

Install required tools

  1. Of course, first you need to setup msysGit
  2. Download Eclipse C/C++ (current version Juno, 4.2 SR2)
    • unzip it somewhere (c:\program files\eclipse)
    • install Java JRE (current version 1.7) - a JRE is sufficient, but installing a JDK is highly recommended
  3. Download MinGW
    • I've used net installer mingw-get-inst-20120426.exe
    • install it; for example C:\MinGW (recommended)
    • This is optional, but I recommend it because of newer gdb (debugger) version

Setup Eclipse Workspace

At this point, you're able to navigate and edit the sources.

Fine-tune Project Preferences

  • Disable auto build
    • Because we've didn't configured any build tools, you should disable Project -> Auto build
    • For our setup, we've only used command line make tool for building git.
  • Enable PE Windows binary parser in debug configurations

Build msysGit

  • For our experiments, we've used this command make clean ; make CFLAGS=-g3 LDFLAGS=-g3

Debug Launch Configuration

For this example, we want to debug the git-add.exe.

Open the debug configuration dialog via the run menu and create a new C/C++ Application configuration:

Happy Hacking msysGit :-)