Eclipse and Git: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
==Git Repo==
==Git Repo==
I'm using ubuntu, so I installed the necessary git tools with the following command:
I'm using ubuntu, so I installed the necessary git tools with the following command:


<code>
<code>
sudo apt-get install git-core
sudo apt-get install git-core
</code>
</code>


I then opened a terminal and cd'd to the location of my project in the eclipse workspace, noted above.
I then opened a terminal and cd'd to the location of my project in the eclipse workspace, noted above.


<code>
<code>
cd /home/dregin/workspace/Project-Name/
cd /home/dregin/workspace/Project-Name/
</code>
</code>


I then set up a .git repo following the steps provided by github, [http://help.github.com/creating-a-repo/ here].
I then set up a .git repo following the steps provided by github, [http://help.github.com/creating-a-repo/ here].


<code>
<code>
git config --global user.name "My Name"
git config --global user.name "My Name"
git config --global user.email email@address.com
git config --global user.email email@address.com
</code>
</code>


'''NOTE:''' At this point the steps want you to create/move into a directory, but we're already in the directory we're going to use.
'''NOTE:''' At this point the steps want you to create/move into a directory, but we're already in the directory we're going to use.


<code>
<code>
git init
git init
git add .
git add .
git commit -m 'My first commit'
git commit -m 'My first commit'
git remote add origin git@github.com:username/repository-name.git
git remote add origin git@github.com:username/repository-name.git
push origin master
push origin master
</code>
</code>
'''NOTE:''' If this isn't your first commit to the repository you plan on using you should merge with the remote repository as follows:
'''NOTE:''' If this isn't your first commit to the repository you plan on using you should merge with the remote repository as follows:
<code>
<code>
git fetch origin
git fetch origin
git merge origin/master
git merge origin/master
push origin master
push origin master
</code>
</code>
==Making Eclipse Play With The New Repo==
* In the package explorer, right-click on the package name.
** Team > Share Project.
* Choose "Git".
It should see the repository that you setup above.
* Click Finish.
That should be you done.
This page is a shit on the face of style. Please fix it.
138

edits

Navigation menu