[solved]EGit and libGDX

I set up libGDX with their project set up tool that splits your project into 2 or more little eclipse projects (desktop, core, android, etc.). I’m fairly new to git, so the first thing I did was give each sub-project its own repository. Obviously this got a bit out of hand and was very inconvenient, so my question is: How can bundle my libGDX project into one git repository (using EGit) instead of many little ones?

Thanks

I’ve never used egit, but you can use regular git client from command line:

  1. Create new git repo for this project in you favorite site (ex: https://github.com or https://bitbucket.org/)
  2. Open folder with your project in command line and initialize git repo via command:
    git init
  3. Next you must add remote origin (just link to your hosted repository) via command:
    git remote add origin https://YOUR_USERNAME@bitbucket.org/YOUR_USERNAME/YOUR_REPO_NAME.git
  4. Added needed files to git. It might be done from command line, but better way is do it in you IDE.
    Please, do not commit .class and other temp files. God practice created .gitignore file project folder. Modern IDEs has plugins for this stuff.
  5. Commit you changes (they will be committed only into local git repo in your folder):
    git commit -m ‘Initial commit’
  6. Send changes to the server:
    git push -u origin master

BTW, github and bitbucket have own tools for managing git repositories. You can download and test (no linux versions :()

That’s all!

I should’ve clarified that EGit is a plugin that lets you use git from Eclipse. It’s super helpful for a person like me who needs some form of visual to know what they’re doing. Thanks for trying though ii8.

Just create a repo for the folder that contains all 3 projects and you’re good to go.

I recommend you look into how the git ignore file is configured and ignore the bin / assets folder of you want to keep the repo small.

I solved the problem by ensuring all three (the core, desktop, and the other that contains the two) are under another folder, then selecting all three in the Project Explorer, and doing the normal EGit setup.
More info here: http://wiki.eclipse.org/EGit/User_Guide#Creating_a_Git_Repository_for_multiple_Projects
You only need to commit (and push) the project that encapsulates all the others.

Thank you for helping!

Now how do I mark this as solved…?

Edit your thread title with [solved] at the start.

You can also use other tags, like [libgdx] as well :D.

Thank you!