Reputation: 1135
I am using Eclipse Helios and EGit. I am new to Git. I have an existing Eclipse project for an Android app I would like to place in Git. Can someone please share some instructions on how to setup a Git repo on a shared folder, and place the existing project into this git repo using EGit? I have tried a variety of options with no success.
Thanks!
Upvotes: 25
Views: 44968
Reputation: 7010
I had the same question (how to do it in Eclipse / eGit), and I just found the answer to the question stated in the title :
Window
> Show View
> Other...
then select Git
> Git repositories
or click the Git repositories icon in the set of icons in the rightCreate Remote
Also, for creating a new project in Eclipse from an existing git repository with eGit, all you have to do is to go in File > Import...
and choosing Git/Projects from Git. Then follow the steps
Upvotes: 40
Reputation: 10654
See http://wiki.eclipse.org/EGit/User_Guide
If you only want one project in your git repo, Team>Share Project will turn that project into a git repo. You can then create another repo on your share, and push your project repo to the shared folder repo.
If you want a repo with multiple projects, your best bet is to create the project in an external location to the workspace. Then you can create the git repo in the folder above your project.
Upvotes: 6
Reputation: 129564
You can do everything from the command line instead:
Do this in the root of the project:
git init
Do the same in the folder where you want your blessed or central repository:
git init --bare
In the local repository, add a readme file and commit it:
echo "testing" > readme
git add readme
git commit -m "initial commit"
Now link and push your changes to the central repository:
git remote add origin //server/share/repodir
git push -u origin master
Hope this gets you started.
You can use egit later if you like, but there is nothing wrong with using git separately.
Upvotes: 12