Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » how to create git branch in remote repository without checking out using jgit
how to create git branch in remote repository without checking out using jgit [message #1403479] Thu, 24 July 2014 01:23 Go to next message
Eclipse UserFriend
Can we create a remote branch in git using jgit without checking out the branch that we are going to branch from. For example I want to create a branch named foo from branch named bar in my remote repository without checking out branch bar locally.
Re: how to create git branch in remote repository without checking out using jgit [message #1403616 is a reply to message #1403479] Thu, 24 July 2014 11:20 Go to previous messageGo to next message
Eclipse UserFriend
This should be possible using e.g. the PushCommand with a refspec refs/remotes/origin/bar:refs/heads/foo.
Re: how to create git branch in remote repository without checking out using jgit [message #1403625 is a reply to message #1403616] Thu, 24 July 2014 12:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Stefan
But for do that as you mentioned, I have to clone the branch bar into my local repo right?. My requirement is to create a new branch foo from the branch bar without cloning branch bar into my local repo(machine)
Re: how to create git branch in remote repository without checking out using jgit [message #1403678 is a reply to message #1403625] Fri, 25 July 2014 05:06 Go to previous messageGo to next message
Eclipse UserFriend
Yes, you have to have a local clone in order to be able to run jgit against a remote repository. AFAIK there is no client which can change a remote repository without a local clone.
Re: how to create git branch in remote repository without checking out using jgit [message #1403879 is a reply to message #1403678] Mon, 28 July 2014 08:02 Go to previous message
Eclipse UserFriend
On some git servers you can create branches directly on the server though this isn't supported by jgit
since this isn't part of the standard git protocols.

In Github this can be done as described here [1].
In Gerrit this can be done as described here [2].

[1] https://help.github.com/articles/creating-and-deleting-branches-within-your-repository
[2] https://gerrit-review.googlesource.com/Documentation/project-configuration.html#branch-creation
Previous Topic:Commit single file or single project only
Next Topic:Issue with Configure Git repository
Goto Forum:
  


Current Time: Thu Jul 03 11:43:29 EDT 2025

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

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

Back to the top