EGit, selecting correct parameters for URI, Host, and Repository Path. - eclipse

I am very new to GIT and am trying to check out some example projects from the eclipse.org git repositories. I just installed the EGit plugin and have reached a roadblock when trying to enter the correct parameters at the "Import Projects from Git" menu.
The location of the examples I wish to check out are located here.
http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/dsf
However I am unsure how to create the correct URI, Host, and Repository Path from this url.
I would like to be able to explore the different repositories listed on that page (for example the org.eclipse.cdt.examples.dsf folder) and checkout those projects, however I just can't figure out what the correct git url for this would be.
I'm coming from SVN, so I am sure I got some terminology wrong. I have been following this tutorial for using git: http://wiki.eclipse.org/EGit/User_Guide#Cloning_Remote_Repositories

If you click on "Summary" in the page you mention (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/dsf), you will get a page (http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/) which displays, at the bottom (you need to scroll down), the clone addresses:
Clone
git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
ssh://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
http://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
You can use one of those addresses to clone from Egit: see "Cloning Remote Repositories" from the user manual.

This page contains documentation from the Eclipse project about cloning their git repositories. They show an explicit example for the org.eclipse.cdt.git repository. You can use either this:
git clone git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
Or this:
git clone http://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git
I usually use git:// URLs when they're available. They used to be faster, but this may not be true anymore. Either should work just fine.
In general, it looks like repositories are available from git://git.eclipse.org/gitroot/<PROJECT>/<REPO>, where it's up to you to correctly substitute <PROJECT> and <REPO>.

Related

Git hub project _ Learning)

I am working on a simple project to learn github. After I worked on my project in eclipse on my local computer, I pushed my project to github for other teammates. A second member of my team pulled this project from github and pushed back to github after making some changes. Now this morning I want to pull this updated project from github to my local machine (eclipse) so I can work on this updated project.
How can I pull this updated project from github to direct into eclipse on my local computer .
I am tried to do:
"git clone http://github.com/testproject/gitDemo.git" but it is not directly going to eclipse. If I save this project on my machine and then try to import into eclipse I got error message, "can not import, there is already one project exist with same name".
I did not see pull option in eclipse under:
Right click on project - team - Pull
Any suggestions??
Thank you in advance for all your help
I'll make one point that I'm not certain you do NOT understand, but as I often see this misunderstood, I'll point it out.
You should separate the notion of "git repository" and "project". When you clone a git repository from github (or bitbucket, or some central repository), you should store it in a directory tree outside of your Eclipse workspace. You then should right-click on the repository and select "Import..." to create a project from the contents of that repository.
Related to that, you should look for the "Pull" operation on the repository entry, not the project. I recommend to display the Git Repositories view on the left side, below the Package/Project Explorer, and make sure that you attempt all git operations in that view, instead of the Package Explorer view.
The only detail from your original post that I can address is the error about already having a project with that name. That error message is not ambiguous at all. You already had a project with that name. I have no idea whether that project was a copy of the repository that you had somehow already imported, or whether it's an empty project, or what. You don't provide any information about that.

GitHub option not available in PyCharm VCS | Checkout from Version Control

I'm trying to clone a repository from GitHub to PyCharm, and so I looked up how to do that. I looked at this website, and it told me to go to
Choose VCS | Checkout from Version Control | GitHub on the main menu. PyCharm establishes connection with GitHub using the login and password you registered. Upon establishing connection, the Select Git Hub Repository to Clone dialog box opens.
From the Repository drop-down list, select the source repository to clone the data from.
But, when I go to VCS | Checkout from Version Control, there is no GitHub, only these options:
So I looked at this answer to this question, which was similar but on Intellij (I hope PyCharm and Intellij work similarly), and the answer was to
Go to File > Settings > Plugins and search for GitHub and Git Integration then install those. A restart might be required in order to apply the changes.
(answer was written by Enzokie). So I went there and those were both installed. What is wrong and why can't I clone a repository from GitHub?
GitHub is a web-based hosting service for version control using Git.
I copied that from their webpage.
The version control system you want to use is Git. And you will connect to GitHub, (which also uses Git), to clone the project you want.
So, select the Git option, enter the project URL and voila!
Another version control web-hosting service who also uses Git (but also Mercurial), is Bit-Bucket.
This Wikipedia page explains what Git is.

How do I get a new branch to show up in Eclipse Git Remote Tracking?

I have an existing Eclipse git project, with a master and development branch present in both local, and remote tracking. I have just added a new branch in my git repository, but I can't figure out how to get it to show up in Eclipse.
I have tried to read up on the subject, but it seems like it is just expected to automatically show up. I have found a lot of similar questions, but they all seem to deal with the issues of a completely empty remote tracking folder, instead of my problem of only a single new branch missing. I already have Master and Develop present.
Here is what does not work:
Clicking refresh in the Git repositories window.
Any kind of synchronize, pull or other update I can find
Here is what would work:
Right clicking the remote tracking folder, and selecting "Paste repository path or URI". If I do that, and select the exact same path as is already there, I can see my new branch. This action does require that I completely clone the whole repository to an empty folder again, and that can't be how this is intended to work.
I believe it might work to use some kind of command line tool, but I really want an Eclipse solution to this, as I feel sure it exists, and I am just missing something.
In the Git Repositories view:
Right-click the repository and choose Fetch from Upstream
If the new branch will not shown up below Branches/Remote Tracking, you have to configure fetch:
Right-click the fetch node below Remotes/origin and choose Configure Fetch...
In the Configure Fetch make sure there is only the single Ref mapping (assuming the remote is named origin) +refs/heads/*:refs/remotes/origin/*:
In case you do not see Fetch from Upstream after right-click the repository, you may look for Fetch from origin.
For me the solution was almost what Joshua suggested, however it did not work as described. For me the solution was to configure the [remote "origin"] property as follows:
[remote "origin"]
url = your_git_url.git
fetch = refs/heads/*:refs/remotes/origin/*
Alternatively, you can do it from the Eclipse UI too:
Fetch from origin... then hit Configure... and in the configuration window hit Advanced... and there you have the option to Add predefined specification where you can selec Add All Branches Spec. This will result in the same configuration as above:
Maybe you have to remove your original entry which will be pointed out as a duplicate by Eclipse.
You need to modify the "config" file in your local git repository folder. For example, you cloned a remote branch Project into c:\git\MyProject local folder. In this folder there is a hidden folder ".git" that has a "config" file. There is a section in this file resembling the below
[remote "origin"]
url http://xxxxxxxxxxxxxxxx
fetch = +refs/heads/Project:refs/remotes/origin/Project
You need to modify this section as below
[remote "origin"]
url http://xxxxxxxxxxxxxxxx
fetch = +refs/heads/:refs/remotes/origin/
Then go back to Eclipse IDE, right click on the repository and do a "fetch from origin". Now all the branches will show up.
What I did:
1: disconnected.
2. refresh and pull. Then, it shows the new branch
3. create local and pull.

New to git--just need to sync one file

I managed to finally get EGit in Eclipse to work (still don't know how) and I've committed/pushed my current project up to GitHub. So far, so good. Looking at it on GitHub's site, I see it wants me to make a README.md file to provide a nice description. Fine, I think, I'll just use the tool it's providing me with to get it started, then have it sync back down to my local computer where I can further modify it and keep it synced.
So I created a quick README.md file on GitHub's site. But now, when I perform a "Pull" action in Eclipse, I am told that there's nothing new to pull, or something like that. Why is it not getting the new file that was created on GitHub's site, and how can I get it so that I can make changes to it whenever I want?
If you have git installed you can use a terminal and type in the root of your repository:
git pull origin master
or you could try checking out only that file:
git checkout README.md

Setting the svn root directory in Subclipse

When I switch to another branch or tag I can't browse the available options in the repository. Subclipse says
Could not find a repository
svn: No repository found in 'svn://foo.com'
The repository is actually at svn://foo.com/bar. I can fetch the branches if I type in the full address by hand but it'd be nice to be able to choose from all available options. How do I tell Subclipse where the repository root is?
Is bar a top level folder on the filesystem of the server?
If not, check that the server has been started correctly by specifying:
svnserve -d -r /path/to/repository/root
In this example, the full path to your repo would be /path/to/repository/root/bar.