How to move Eclipse project from one Github repo to another? - eclipse

I am new to github. I cloned my github repo to eclipse using EGit.
Now, I have two repo in my Eclipse.
I added my Java Eclipse project to the old repo. I would like to added my Java Eclipse project to new repo. How could I move my Eclipse project from one repo to another?

From eclipse, you can right click on a project and select the Team > Disconnect menu option to disassociate the project with the old git repository. Then right click the project again and select the Team > Share Project option. From the 'Configure Git Repository' dialog, you may need to uncheck the "Use or create repository in parent folder of project" check box. You will then be able to select the location of the git repository you want to associate with the project.

Related

configuring github project with eclipse[EGIT]

I have configured Eclipse with GIT plugin and also created a repository in github
now i want to add all my existing project from eclipse to the github repository through eclipse plugin
Can someone please suggest the steps
I am able to checkin the projects, followed below steps
creating git hub workspace
open a git repository[window --> git repository]
click on clone a git repository
in the uri share github clone url https://github.com/******/scala.git
select the local workspace director in "Local destination" C:\software-Neon\Git-Workspace and click on finish
adding project
right click on project and then team --> share project
in the repository select the git repository created in step 2 and click on finish
right click on project and then team --> add to index
then right click on project and then team --> commit. enter commit messge then commit and push. [enter credential]
retrieving existing project from github
open Git repositories view
right click on Git-workspace then "pull" then finish
open package explorer then import --> Git --> projects from Git
select existing local repository -->workspace --> import existing eclipse projects
select the projects to be imported
6.click on finish

Projects not visible in Eclipse after Git checkout

I initializing git repository in the eclispe workspace and added remote repositories from Github. I did a git fetch and then checkout out a branch from the remote from within eclipse git view. The projects that were visible in the project explorer and package explorer and no longer visible now. Tried to import them using from file->import menu but I see a message Some projects cannot be imported because they already exist in the workspace
I'm using Eclipse Mars.2 (4.5.2) version. I noticed the same behavior with STS (3.7.2) also. Is there a way I can get back the projects shown in eclipse again?
Some projects cannot be imported because they already exist in the workspace
That is not related to git, and more related to how Eclipse is managing its workspace: it cannot accept two eclipse projects with the same name.
Try switching to a brand new workspace, and re-import your Eclipse project there.
If that eclipse project is in a local git repo, share it with Git and Eclipse will detect that existing git repo.

How to add Git nature to my project?

I cloned master branch into the directory
\home\David\git\Example
and then I went into the eclipse and imported this project and when i did that it imported the project to the directory
\home\David\workspace\Example
Now the problem is when I right click on the project in eclipse and select properties, I don't see git nature for this..
The below screenshot is on my office laptop
I have Egit plugin installed and I would like to be able to commit and push from eclipse..
Because the git nature is missing for the project, I cannot do that.
How do I add Git nature for the project?
Answer for someone who imported a project, for example, as a maven project and not as a git repository:
Right now, the fastest way to add git nature to your eclipse project is to right click to your project > team > share project
you should see your repo listed. Just click ok.

no commit button in Team menu in eclipse when checking out project from github

I create a local maven project in eclipse. I share the project on github remote repository. and the Team menu comes to have a list of buttons like commit, revert etc. Just like using svn.
Now I checked out the same project from the same remote repository on another machine. The project was checked out successfully but the Team menu has only Share button. Eclipse dose not recognize it is checked out from a scm.
What to do to make eclipse has the list of buttons in Team menu when checking out a git project?
Chances are, you have not installed the egit plugin on the second machine, therefore Eclipse doesn't know anything about git repositories.

How do I enable MercurialEclipse plugin for a project?

I have a project using mercurial for version control, and I'm trying to set it up in Eclipse. I cloned the project from the command line and then opened the project in eclipse by importing it as a maven project.
This works except for that eclipse/MercurialEclipse doesn't seem to pick up that this is an merurial repo.
If I go to project properties, the Mercurial option shows only the message "This project doesn't use MercurialEclipse as a Team provider."
In the "Team Synchronizing" perspective, Synchronize... just gives me a "clone repository wizard" saying "There are no Mercurial resources to syncrhonize".
Does anyone know how to get MercurialEclipse to pick up the existing repository for the project.
Figured this out myself.
Right click the project and choose Team > Share project...
That gives a wizard for enabling mercurial integration for the project.