Is there any way to use git-svn from within Netbeans. I'm currently working on a project that uses svn, and I'd like to at least use git locally.
NetBeans currently does not support git-svn. You still may use NetBeans for local Git repository, but you have to run git svn rebase and git svn dcommit yourself.
Another option is to use SubGit on a server-side:
Install SubGit into your Subversion repository, see documentation.
Setup remote access to created Git repository, e.g. using git-http-backend.
After that you may clone that Git repository via NetBeans and work with it as with usual Git repository.
On every push SubGit automatically converts your Git commits into Subversion revisions.
When someone commits changes to your Subversion repository, SubGit automatically converts them into new Git commits. So, you get them with a normal pull.
Hope that helps.
Related
My client is using SVN and my company is using Git (central bare Git repo). So I have the task to sync both servers. I can't use SubGit , because I can't do any modification on either server.
I successfully used git-svn to download the SVN to my local Git repo (using TortoiseGit). But I can't figure out how to set up a remote upstream to the central Git Repository (using Egit in Eclipse).
Is it possible to set up a remote branch, so I can check in the SVN stuff from my local Git into the central Git repo? How?
thanks.
If I understand correctly, you can't update hooks in SVN and Git repositories. That complicates the task a lot, because you can't reject pushes Git if someone is committing to SVN at the same moment and vice versa.
I think, that git-svn is not a solution because on sending commits to SVN ("git svn dcommit") it changes Git commit SHA-1 to add git-svn-id: signature. As result when one pushes commit C to your Git repository, you fetch that commit to your git-svn repsository, run "git svn dcommit", it translates it to SVN and adds git-svn-id: signature to commit message thus changing commit SHA-1, so you'll get another commit C' in git-svn repository. After that C' should be sent back to the Git repository, and after that the user that pushed C should download C' and replace C with C' in his working copy. So you won't have easy and transparent synchronization.
With SubGit you can reduce your problem to synchronization of 2 Git repositories by creation of an "intermediate" Git repository with SubGit installed into it. Synchronization of 2 Git repositories is a simpler task (and there's a lot of solutions on the internet) but it's still isn't a piece of cake, because 2 different users can push into both repositories simultaneously (and you can't discard one of the push, because you can't create hooks in the repositories). If these changes are conflicting, you can resolve that only manually, and I'm afraid this is the best you can do: create a repository with 2 remote and using a script constantly fetch changes from one of them and push the changes to another one and vice versa (and notify the administrator and stop synchronization on simultaneous conflicting changes).
Disclaimer: I can be biased because I'm one of SubGit developers.
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.
I have a java/GWT project in eclipse , There is a Git repo git#github.com:example/example.git
where i want to put my complete project for the first time
Please guide me how can i do this , I am new to Github
I have searched a lot ,but couldn't able to do it successfully
I do have GIT Bash and GIT GUI
Thanks
Note that instead of having a msysgit installation (git bash and git gui), you could install on Windows the new windows.guthub.com:
That will facilitate cloning that repo.
The other alternative is to declate and clone it through Egit within Git, as described in this tutorial: Using Egit with GitHub.
Note that Eclipse+Egit means you don't have to install a msysgit (it is still recommended though, to benefit from the rich CLI of git outside Eclipse).
Follow the setup and create a repo instructions on github itself.
Basically you're going to do the following:
Install git on your development pc.
git init to create a local git repository for your project.
git add your files to the local repository.
git commit changes to the local repository.
git push to the remote github server when necessary.
Search Stack Overflow - try this post for starters: Git for beginners: The definitive practical guide
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.
I'm thinking about migrating a project from Sourceforge to Github. Besides the svn to git, what about migrating things like the issue tracker? Is there an easy way to do that?
For SVN to GitHub part, this is now the easiest way: https://help.github.com/en/github/importing-your-projects-to-github/importing-a-repository-with-github-importer
But it doesn't import issues.
I've written a Python script to migrate issues. It's at https://github.com/ttencate/sf2github.
Beware: Sunday afternoon software. Use at your own risk, etc. etc. Pull requests welcome!
since I just have done this here is my approach
create a local git repository from the remote svn repository
git svn clone http://svn/repo/here/trunk
now push the repository to github
git remote rename origin upstream
git remote add origin git#github.com:myname/myproject.git
git push origin master
This script uses rsync to sync the raw svn repo onto your /tmp directory and requires the svn2git ruby gem for importing the svn commit info into git.
If you happen to use a newer version of the SVN infrastructure provided by sourceforge (aka SVN 2.0 dev), you can use this script instead - I forked off the original to just make changes to the rsync command. :)