Cloning a github repo into an existing project?

clone, eclipse, github

Solution

GitHub has a guide explaining how to put an existing project on GitHub.

You should not clone the repository, but add the GitHub repository as a remote to a local repository you create yourself.

- Go to your project folder and initialize a local repository with `git init`

- Add and commit all your project files to the local repository. (e.g. `git add .` and `git commit -m "message"`)

- Add the GitHub repository as a remote. `git remote add origin *github repository URL*` (Verify with `git remote -v`)

- Push your project to GitHub with `git push origin master`.

If you already have committed files to the GitHub repository, it is still possible.

- Initialize your local repository.

- Add GitHub as the remote.

- Pull from GitHub.

- Add and commit your project.

- Push you project to GitHub

Problem

I have a project in Eclipse that I want to put on github, so I went to github and created the repos for them, but I want to clone them right into the folder where the files are stored in my eclipse workspace. How can I do this? EDIT: When I try it, the github app says it can't clone because the folder isn't empty. EDIT 2: Will this work? Changing the name in eclipse to rename the project folder, then cloning the repo to the name I want, in the workspace, then renaming the eclipse project so they merge and I can commit the new files.

Original source

Related problems