You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Eclipse_and_Git.md 1.7 KiB

4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. So after having a bit of a head bashing session getting an eclipse
  2. project to work nicely with a git repository hosted on github, I thought
  3. I\'d throw my approach up here to save others torture.
  4. ## Eclipse git plugin
  5. I\'m using EGit.
  6. I used Eclipse\'s Update Manager, adding
  7. <http://download.eclipse.org/egit/updates> as the site for the plugin.
  8. ## Eclipse Project
  9. I went about setting up my project in eclipse as per usual, noting the
  10. location of my workspace.
  11. ## Git Repo
  12. I\'m using ubuntu, so I installed the necessary git tools with the
  13. following command:
  14. `sudo apt-get install git-core`
  15. I then opened a terminal and cd\'d to the location of my project in the
  16. eclipse workspace, noted above.
  17. `cd /home/dregin/workspace/Project-Name/`
  18. I then set up a .git repo following the steps provided by github,
  19. [here](http://help.github.com/creating-a-repo/).
  20. <code> git config \--global user.name \"My Name\"
  21. git config \--global user.email email@address.com </code>
  22. **NOTE:** At this point the steps want you to create/move into a
  23. directory, but we\'re already in the directory we\'re going to use.
  24. <code> git init
  25. git add .
  26. git commit -m \'My first commit\'
  27. git remote add origin git@github.com:username/repository-name.git
  28. push origin master </code>
  29. **NOTE:** If this isn\'t your first commit to the repository you plan on
  30. using you should merge with the remote repository as follows:
  31. <code> git fetch origin
  32. git merge origin/master
  33. push origin master </code>
  34. ## Making Eclipse Play With The New Repo
  35. * In the package explorer, right-click on the package name.
  36. * Team \> Share Project.
  37. * Choose \"Git\".
  38. It should see the repository that you setup above.
  39. * Click Finish.
  40. That should be you done.
  41. This page is a shit on the face of style. Please fix it.