I am trying to create a local workspace for a repository that I was invited to on Plastic Cloud. If I have the server name/port and repository name, how would I "clone" the project locally for me to work on. I know this is a basic question, but the Plastic docs have been super unhelpful. I was told by the person who invited me to the project that I need to search for the server in the "Cloud" section of the GUI, then when the repo shows up, right click and create a new workspace. When the repo comes up, right clicking only gives "Create New Sync View".
Join a Cloud project using the wizard
When you start Cloud Edition for the first time, you should see a screen like the following:
Where you can enter your Cloud Credentials.
After you enter your credentials, you go to the next screen where you can "join an existing cloud project" and then all the local repo creation and workspace creation is done for you.
Join a Cloud project manually - screencast
In case you already had Plastic SCM installed and configured, then the wizard will not show up, but joining the project is still quite easy.
The following screencast shows how to create a local repo joined to cloud manually: https://youtu.be/ECVAHTH8Dcg.
Join a Cloud project manually - step by step
Let's now check how to do it manually (which is the same you would do for a regular non-cloud repo you want to replicate).
First create a new local repo to host the clone from Cloud. Go to "repositories" and then click "Create new repo".
Now create a new workspace for this new local repo: (you know, go to "workspaces" first...)
And finally you can pull branches from the Cloud... but you know how to do that from the sync view or even the Branch Explorer (just right click on "main" and do "pull from...").
From the command line
By the way, it is less visual but faster from the command line:
cm mkrep localrep#local
cm mkwk localworkspace path_to_the_workspace
cm replicate main#cloud_repo#your_cloud_org#cloud localrep#local
Hope it helps!
Related
as I just installed Plastic SCM on my home computer, and connected through Unity, I was prompted to choose Organization. I managed to select the incorrect one and now I can't find a way to change organization within Plastic SCM.
The repo is already on the cloud according to my dashboard on the Plastic SCM website, but there is no option inside the application to switch server or organization.
Any ideas how to fix this?
There are two solutions to this, First, you can delete the local repo that you have cloned(the wrong one apparently as you said), or if you don't want to just create a new workspace. In the top left corner, you may find your repo name with a dropdown, click on that and create a new workspace. The new workspace dialog box will appear to select which repo you want to clone and a new workspace will be created for you with that repo.
Also there is a repositories and workspace thing in the left hand menu, if you click on the repositories and in the right hand side change the server to the desired organization. You will see a list of repos of that organization you have access to. Right Click the required repo and select create a new workspace option.
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.
I am in need of help in trying to setup Eclipse so that I can push my code onto my GitHub account. I've searched online and the tutorials I have found are either outdated or don't work for me.
I already have a project on Eclipse. How would I put that code onto GitHub? Would someone please add detailed instructions please. Any help is appreciated.
EDIT
As soon as I posted this question, and fiddling around with the settings I managed to get it to work! What a coincidence...
The only problem I have now is how do I set it up so that when I commit it will only select the files in the project folder? Right now it is showing all 600 files in the Package Explorer.
Alright, there are several ways of doing this. I found this to be the easiest way:
First, set up SSH2 configurations. Go to Windows->Preferences->General->Network Connections->SSH2->Key Management and Generate RSA Key. Save Key
Copy that key. You will need to go to your GitHub account settings and add the new SSH key to your account.
Now, you need to install eGit:
Next, you want to add the Git Repositories view:
Create a new Git Repository. I have already created a repository called Java. I will refer to that repo for the rest of the explanation.
After you create your repository, it should show up in the Git Repositories view. Now to add your project to the repository, right click on your project and select Team->Share Project.
Select the repository you just created. You can also use CTRL+ to select multiple projects and place them in one repository.
Now go back to your Git Repositories view. Go to Remotes . Right click and select Create Remote.
Select Change... and enter the SSH link for your Repository on GitHub.
For connection, select SSH. Then press Finish.
For Rev-mapping, select Advanced....
For Source Ref select refs/heads/master. And then press Add Spec, then select Save specifications in 'origin' configuration. Then press finish.
That's pretty much it. You can commit changes by right clicking your project - >Team->Commit...`
Push new commits to GitHub:
This is a really good explanation on how to set up Eclipse pull requests.
The current branch is not configured for pull No value for key branch.master.merge found in configuration
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 am creating a totally new OSS project for my organisation and I want to host it on GitHub. The project will be developed using Eclipse and I am using EGit. I have no prior experience with Git, as I've previously only used SVN.
Here's what I did so far:
Created a new account for my organisation on GitHub. (I already had a personal account.)
Created a new repository under my organisation's GitHub account for this project.
Under the new repository's "Collaborators" section, added my personal account. (I verified this in my personal account.)
Installed EGit into my Eclipse. (I am using Eclipse 4.2 with EGit 2.0.0)
Created a new Eclipse project in a new Eclipse workspace. (It's a Maven project so I created it through m2e but that shouldn't make a difference.)
Added the new Eclipse project to a new Git local repository (via Team -> Share Project).
Created the .gitignore (ignores Eclipse-specific files and directories).
Added source to the project (via Team -> Add to Index).
Committed local changes to my local repository.
Copied the HTTPS URL from GitHub.
Team -> Remote -> Push
The URL from the clipboard was already taken and most fields populated.
Entered username and password for my GitHub personal account, clicked Next, data was fetched successfully.
Selected "refs/head/master" from the Source ref dropdown (I didn't understand this entire page, maybe I've put something wrong?)
Clicked "Add Spec" and then Next
At this point, I got the error "master: master [rejected - non-fast-forward]"
I searched on Google, but the suggested resolution was to do a Pull. I tried "Team -> Pull", but got the error "The current branch is not configured for pull; No value for key branch.master.merge found in configuration"
Can anyone help me? My remote repo is still empty (save for the .gitignore and the README.md). I want to get files from my local into that remote repo!!
That looks like there is already committed content in your Github repository. I don't exactly know what is going wrong, but I would do it different:
First install Mylyn and the Mylyn GitHub connector in Eclipse. That way you can access github repositories much easier.
Use the Mylyn Github connector to clone your existing (assumed to be empty) Github repository into a new local repository (File->Import->Git->From Github). That is the easiest way to verify your login credentials, ssh keys and so on.
During the previous cloning step, the github repository was automatically added as "upstream" repository reference to your local repository. So if you now add files to your local repository, you can commit them and afterwards use "Push to upstream" to make them available on Github. No configuration of the remotes and refspecs is necessary in that case.
Now create your new Eclipse project and share it using the Team -> Share, where you select your existing local repository.
Everything beyond that would be as you already described.