egit for eclipse: How do I put my existing project in the clone of my buddies repo? - eclipse

My buddy gave me his git address for the project we are going to work on. In Eclipse using egit I cloned his branch.
So now in my Git view I have my own repository I created of an existing project. I want this existing project to be on my buddies branch so we can both check it out and have it in our repo.
Unfortunately I am using Windows to do this because we are developing a game and I do all of the art & animation in addition to programming. I would feel much more comfortable on the cmd line than using this plugin..
Any help is much appreciated!

The notion of repo and branch are quite different.
If you have a clone of our buddy's repo, you can work on a branch named like the one your buddy uses (by default 'master' if he hadn't created any other), and everything you will push will be added/merged to the remote branch in the remote repo.
For more on Egit, see this "Git with Eclipse (EGit) - Tutorial", and check if yuo can push at least one file, that your colleague will be able to pull from the remote repo and see directly in his branch.

Related

How should I correctly push my project to github using eclipse?

I work in Eclipse. I have a maven project and usually, I commit and push it to my remote repo on GitLab. Now I want to push this project to a brand new GitHub repo. I've already created an empty repo on GitHub and pulled it to my local machine. So I already have a corresponding empty local repo too. The thing is I don't understand how to push my project to my new local repository and then push it to Github.
Usually, I use Egit but I can use the command line as well.
Maybe my logic is wrong? What should I do to have my project on GitHub then?
Thank you in advance.
I'm not sure if I understand your problem, if you were already pushing to GitLab with Egit. Have you tried to do it yet? Are you getting errors?
You should be able to use Egit the same way by committing to your local repo and then pushing to GitHub instead of GitLab.
The only difference would be having to use your GitHub credentials (or associating your SSH key to GitHub), and then specifying your GitHub repository.
https://wiki.eclipse.org/EGit/User_Guide#GitHub_Tutorial
The only thing that you had to keep in mind is to make sure your branch specs match. I think you might see "HEAD" by default, but you can change that to "master" if that's all you have.

Synchronizing copied repository with GIT repository

I have copied repository from my team member and I want to synchronize with GIT repository.
Please keep in mind that I am new to GIT and I only have URLs of the repository where I need to synchronize. I need help to connect my repository with GIT repository. I have not imported any repository and I have just copied that. I will be able to push or pull or merge etc. only if my project is synchronized with remote repository. Please let me know that how can I synchronize. Thanks
It's unclear from your question whether you are trying to simply keep two copies of the same repository synchronized or something else.
If it's the first, then what you want to do it a git clone. Your changes should be git commit, to get remote changes you should git pull and to push your changes to your co-worker's repository, you should git push.
Depending on your operating system, there are different front-ends for Git. I gave you the command-line version. I saw you tagged your questions with the eclipse tag, which suggests you are trying to do this inside Eclipse. In that case, you might find EGit useful. See the EGit User Guide here.
If all this sounds too complex for you, you should first Read The Manual - that is, check out the Getting Started chapter of the Git Documentation.
I found the solution. I had to go in team-> share projects. then "create a new repository location" and paste the url of git repository. then team->share project-> git and add the repository. Now my copied repository is linked/connected with my git repository and I am able to synchronize my repository.

manage git clone on remote server with eclipse

I'm new to git and github and I have a question about the git plugin for eclipse Egit.
I have made a clone from my github repository to a remote server (other than github) which I will call 'rserver' for the ease. Now I am editing the files in my repository on 'rserver' locally from my computer with eclipse (and the RSE plugin) but when I want to do any git actions like committing the changes I made, I do that directly on the 'rserver' (command line). Now I would like to be able to commit changes etc. with eclipse and (what I presume to be the best option) the egit plugin. Since all code needs to remain on the 'rserver' to be functional as a program, there is no point of making another local clone of my github repository. But all options I've tried with egit seem to do exactly that.
Is it possible to manage all git actions between 'rserver' and github from my local Eclipse SDK (other then using the terminal in eclipse)? And if so, then how?
git clones repos, meaning they contain the same objects.
I don't think there's a way to work on a remote repo, but you should git clone your rserver repository locally, work and commit there (this using eclipse), and when you want to upload your code to rserver or github, you just push your changes there.
When you git push, you make the remote branch point to the same commit your local branch points, uploading any remote-missing object.
Probably you will want to add both remote repostiories (rserver and github) as remotes of your local repository, so then you can decide to whether of both to push changes to.
There is much value in being able to edit files remotely and there is much value in being able to version control your files in git. Currently I have the same situation. My "rserver" however, is a Puppet master. I'm editing the files through RSE on the Puppet master with my local PC in Eclipse. There's a lot of value in editing the files directly on the Puppet master, trying out the change and if it doesn't work continuing to modify the files. Having to then ssh into the server just to do git actions is dumb. Having a local git clone that you have to git add, commit, push, then go to the server and git pull is even more dumb. Eclipse should allow you to do git actions through RSE.

How do I get MercurialEclipse and Bitbucket to talk to each other?

I'm an Eclipse user, but I'm a newbie to Mercurial and to Bitbucket. I think I understand the command-line hg commands. I can create repositories, clone, push, pull, update, that stuff.
If I have a project in Eclipse, I can create a local repository for it. I can't figure out how to clone this repository up to Bitbucket.
If I have a project in Eclipse, I can create a remote repository on Bitbucket. Then I don't have a local repository, so I can't use any of the Team... commands, and can't do anything.
If I have a repository on Bitbucket, I can't get to it, because I don't have a local repository, so again I can't do anything.
If I create separate repositories locally and on Bitbucket, then I have two different repositories, and I don't know enough Mercurial to merge(?) different repositories.
There must be some blindingly obvious to get a project off the ground, but I'm blind to it. I can do this just fine from the command line, but MercurialEclipse is defeating me. No luck so far with Google and assorted documentation...
Help?
Doing it using Eclise "Team" UI:
Create a project in Eclipse and "share" it using Mercurial repository type. That will create local repository (by default in the same location where your project is).
Create project repository on BitBucket.
Use "Team">"Push" to push local changes to your remote BitBucket repo. First time it will ask you to enter the repository URL, user name and password. All this information is available on your Bitbucket web UI.
Don't forget that you have to do 2 stage commits after that. Commit in Eclipse UI will commit it in your local repository. In your team perspective's Synchronize view you will see additional "Outgoing" and "Incoming" entries. Using right-click menu on them you will be able to push/pull your changes to/from your BitBucket repo.
Remote repo information can be managed in special "Mercurial Repositories" view.
More info can be found in the tutorials at http://ekkescorner.wordpress.com/blog-series/git-mercurial/
Following the directions provided by bitbucket should be enough.
You can either create a repository on bitbucket and clone it on your desktop:
hg clone https://bitbucket.org/youraccount/yourproject
...
hg pull -u # to pull changes and update
hg push # to push changes to this repo
Or use a local repository and push these changes to a newly created repository on bitbucket:
cd /path/to/existing/hg/repo/
hg add [...]
hg commit
hg push https://bitbucket.org/youraccount/yourproject
Basically, two repositories are "bound" by:
a common changeset in their history
the [paths] configuration in /path/to/existing/hg/repo/.hg/hgrc, that lists remote repositories you can read/push to.

Git/Mercurial locally ontop of local cvs checkout

I have read :
"Best practices for using git with CVS"
"How to export revision history from mercurial or git to cvs?"
, and neither suit my needs.
At work we use a remote CVS repo. Access to this repo is handled via eclipse CVS tools, and in-house eclipse plugins that are built ontop of team tools for eclipse. This means we can't move to a better vcs.
However I would like to use Git on my local machine (to enable personal branching) such that I can accomplish the following:
Create branches in Git and then once finished and merged back into my local trunk, commit back to the cvs repo using the eclipse team tools etc.
My plan is something along the following lines:
Copy the checked out files to another folder [gitRepo].
Create a master git repo in gitRepo
Branch in gitRepo and make changes.
Commit to gitRepo
Copy gitRepo back to checked out files
Sync with remote cvs.
I was planning on using eGit for eclipse however I believe that the CVS and .git files will compete for ownership of the versioning.
Are there any tools or suggested work flows to help me manage this? Also how well does Git play with CVS files. And vice versa since I don’t want them to infect each other.
The reason the former links are of no use is they commit straight to the cvs repo from the git repo and this worries me as I do not wish to infect the cvs repo by accident.
It should also be said that changes in the GitRepo do not need to persist into the CVS repo, for example I don’t need to see every push to the git repo reflected in the remote CVS.
~Thanks for reading.
You perfectly can create a git repo directly within a CVS workspace (much like directly within any other VCS tool.
Make sure git will ignore any .cvs resources, and make sure CVS will ignore the .git.
Any Git commit won't be directly reflected in CVS.
The only trick is for Eclipse to display only Git or only CVS informations and label decoration.
For that I would configure two different Eclipse perspectives in which I will de-activate one or the other VCS tool.
I have done exactly this at work and I found the following practices helpful:
Keep any one (master in my case) branch always in sync with CVS. Do not use this branch for your development. Periodically update this branch to get the changes made by the rest of the team. If these changes are relevant to your current work do a merge master from your dev (or any other appropriate) branch.
When you are ready to check in to CVS switch to the master branch and merge the changes from the appropriate branch (dev, feature etc. as appropriate). Run your tests!
You employer most likely will keep a back up of the CVS repos. You will have to find a way to keep your git repo backed up. One way is to add a mirror repository in a Dropbox folder and use a post-commit hook to update it after each commit.
Before you leave work switch to the master branch. I once made the mistake of running CVS up -d on a dev branch in the morning and ended up quite confused. Adding a script to automatically switch to master before updating helps.