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
Related
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.
I created a git repository on my local computer:
git init
git add TestGit.java
git commit -m "Start"
I then went into Eclipse and chose to import and create a new project from that Git repo. During the Wizard steps, it recognized the .git directory and saw it as a repo (when I check in "Preferences", it shows under repositories) but when I then click to create the new project it fails everytime with:
Connecting Git team provider failed. See log for details.
Connecting Git team provider failed. See log for details.
Error connecting project Git Test, no Git repositories found
What could be wrong?
Edit: If I import it as a general project instead of as a new Java project, then it works! Why?
In the Import Projects from Git dialog the Use New project wizard option seems to be broken (see Eclipse bug 324145).
To import an existing Git repository use File > Open Projects from File System... (instead of File > Import... > Git > Projects from Git). Because of the contained TestGit.java file the project is detected and configured as a Java project. The local Git repository is also detected and added automatically.
Only if it is a Gradle project (if it contains a build.gradle file), use File > Import...: Gradle > Existing Gradle Project instead (at least until this feature request is implemented).
It worked for me:
after selected Use New project wizard option, pay attention to select the workspace location, it should be set at the local repository location and not at the default workspace location.
I hope this help you!
I encountered same error trying to clone and import. In the end I got it work using
File --> Import --> Git --> Projects from Git (with smart import)
which incidentally seems to clone the repository and then use the abovementioned
File > Open Projects from File System...
To me some of the above answers helped me. However, it wasn't perfect. Besides, my project was a Maven one on the Github. Here are my 9 steps.
(from github, copy https URL to clipboard)
(in STS-eclipse) File > Import
Git > Projects from Git > Next
Clone URI > Next
(paste copied URI into URI--it's automatic actually.) > Next > Next
(change "Directory:" box value if needed) > Next
(choose "Import as general project") > Next
Finish
(right click project node) Configure > Convert to Maven Project
Now the project should be a Maven project.
End.
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.
The only way I seem to be able to get use git in eclipse is to create a non-git project then turn that into a repository. This ends up moving the project out of the eclipse workspace on the file system. I then have to delete the project(it's still in the git repository), then import a git repository after creating a branch and clone it to get it back into the eclipse workspace.
Is there a simpler way?
I simply want to create project that is really a clone from a local repository. Essentially I have two copies on my HD but I can commit the eclipse project to the git repository. Unfortunately there has to be a better way?
To answer this question involves three steps.
Create a external (remote) repository
Share the project in a way that it remains in the workspace
Connect the project repository to the remote repository
Create a Remote Repository on Your Local Machine
Switch to the Git perspective. Click on Create a new Git Repository.
When a dialog appears select a directory where you would like your remote
repository to be. This is were your project will be pushed to. You will also
want to select the Create as a bare repository option.
That's it for this step. You should now have this repository in your EGit
repositories list.
Sharing Project within the Workspace
There are two ways to share a project so that it remains in your workspace.
1. Make the project directory a repository
2. Make the whole workspace directory a repository
The Project as a Repository
The first option option is not recommended by the Eclipse team. This issue is
described in more detail at Why is not recommended to have an Eclipse project folder as a Git repository?.
The basics of the issue are twofold:
You can't have more than one project per repository
If some thing happens to your workspace you'll lose your repository too
Issue 1 isn't solved here. Issue 2 can be solved by connecting to a remote
repository as show later.
To share the project as a repository:
Right click on the project
Select Team -> Share Project... from the popup menu
Click Use or create repository in parent folder of project
Select the project from the list
Click on the Create Repository button
Click the Finish button
Next you'll want to connect your newly created repository to the remote repository.
That's covered below.
The Workspace as Repository
The second options allows multiple projects to be added to your repository.
In fact any new project you create will automatically added to the repository.
Automatically adding projects can cause some issues.
One issue is that, if there are changes in multiple projects, staging
those changes can take a bit of wading through. Using a Tree presentation when
staging can simplify things.
Another more serious issue occurs when importing a git clone of a project into
the workspace. This importing will create nested repositories. Nested
repositories can cause problems
according to this post.
By default Eclipse doesn't import the git clone of the project into the workspace.
To share the workspace as a repository:
Right click on the project
Select Team -> Share Project... from the popup menu
Click on the Create button
Select your workspace as your Repository directory
Click the Finish button
Once your repository is created you may want to do a little house keeping. I suggest
adding the RemoteSystemsTempFiles project to the .gitignore file. Note: the
.metadata file is added automatically by Eclipse.
You can ignore the RemoteSystemsTempFiles by:
Switching to the EGit perspecitive
Selecting the workspace repository from the list of repositories
Select the Git Staging tab
Click on the View Menu button on the right side the the tabs toolbar
Select Presentation -> Tree menu (folders are easier to ignore form the tree view)
Right click on the RemoteSystemsTempFiles project
Select the Ignore Folder menu
Ignore other projects in the same way
Connecting to the Remote Repository
The last stage is connecting the workspace repository to the remote repository
we created earlier. Once you've switched to the EGit perspective:
Expand your workspace respository
Right click on the Remote node in the tree
Select the Create remote... menu
Leave the remote name as origin
Select Configure fetch
Press Ok
Click on the Change... button
Click on the Local File button
Select the bare repository that you created in the first section
Click Finish
Click Save and Fetch and then Ok
You can then stage, commit and push changes in your projects and workspace.
When you first commit and push EGit will push the default branch master
to the remote and configure pulling this branch from remote repository.
Follwing the User Guide, you would need to create the .git repo within your current project path:
If the .git path is within the current project path, there is no reason EGit moves your files anywhere else.
I have added a new GIT repo (private github repo) to Eclipse EGit repo explorer. In the working directory, our team has many projects - some python, some C++, some PHP - they are in different sub-directories. I choose a dir with python project and from the context menu I select "Import" then complete the steps with "New Project Wizard". I choose new "PyDev" project and end up with new project that is empty - only Eclipse files like the .project inside.
I want to create a new python project with the contents of ~/git/repo - I don't want external other copy of the tree.
You could follow this tutorial, and share your project.
That would create a local Git repo, to which you can add your private GitHub repo as a remote.
See also "Pushing a Local Repository to GitHub ".
Select your new Eclipse project and click "Team" > "Push To" and enter "Your GitHub Clone URL" and your GitHub password (with the free GitHub accounts, do not enter a password but leave blank), leave the user as "git"