Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » JGit Committing Into a specific branch
JGit Committing Into a specific branch [message #903367] Thu, 23 August 2012 07:25 Go to next message
R J is currently offline R J
Messages: 8
Registered: August 2012
Junior Member
Hi

I am working on a project and need help. I am using JGit for my version control system.

Basically, I can create branches.

What I would like to do is, once I have created the branch I would like to commit into the same branch each time. Is there a way of doing this through JGit?
Re: JGit Committing Into a specific branch [message #903379 is a reply to message #903367] Thu, 23 August 2012 08:37 Go to previous messageGo to next message
R J is currently offline R J
Messages: 8
Registered: August 2012
Junior Member
Just to add to this:

Each time I return the branch name it returns master. As soon as I change view in the GUI, and when I execute the code again the return branch name is the 1 I created. So is there any way of setting branch name as the default?
Re: JGit Committing Into a specific branch [message #903402 is a reply to message #903379] Thu, 23 August 2012 09:47 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 556
Registered: July 2009
Senior Member
With Git the commit command is always acting on the currently checked out local branch.
So if you want to commit to a different branch you first need to checkout this other branch.
Re: JGit Committing Into a specific branch [message #903406 is a reply to message #903402] Thu, 23 August 2012 10:02 Go to previous message
R J is currently offline R J
Messages: 8
Registered: August 2012
Junior Member
I actually figured this out, but thanks for your help.
Previous Topic:Remote Tracking autoupdate does'nt work - feature or bug?
Next Topic:remote git init failed?
Goto Forum:
  


Current Time: Wed Aug 27 21:20:10 EDT 2014

Powered by FUDForum. Page generated in 0.04047 seconds