Reputation: 863
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.
Upvotes: 2
Views: 8849
Reputation: 322
First add the remote as follows
git remote add origin <GIT URL>
Then simply do the following (MAke sure to commit any of your local files)
git pull --allow-unrelated-histories
Upvotes: 1
Reputation: 7457
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.
git init
git add .
and git commit -m "message"
)git remote add origin *github repository URL*
(Verify with git remote -v
)git push origin master
.
If you already have committed files to the GitHub repository, it is still possible.
Upvotes: 6