Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit Committing Into a specific branch
JGit Committing Into a specific branch [message #903367] Thu, 23 August 2012 11:25 Go to next message
R J is currently offline R JFriend
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 12:37 Go to previous messageGo to next message
R J is currently offline R JFriend
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 13:47 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
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 14:02 Go to previous message
R J is currently offline R JFriend
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: Thu Apr 25 21:38:35 GMT 2024

Powered by FUDForum. Page generated in 0.02740 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top