Community
Participate
Working Groups
When you use JGit PushCommand and you don't specify an explicit refspec then JGit uses implicitly a refspec which potentially leads to the creation of a new branch in the remote system. The new branch will have the same name as the currently checked out branch. Here JGit behaves differently from native git, where a push without an explicit refspec leads to the update of all "matching" branches (branches which exists locally and remotely). A native git push would not create new branches. My problem is that JGit under the hood (without an explicit refespec) takes my local branch names to create branches on the remote system. Up to know I was sure that I can name my branches as I like (tmp1, tmp2, f***ingBugFix, ...) because I knew that J/EGit will never publish these names without my explicit order. That's not true anymore. My proposal: If we can't have these "update only matching branches" rule then we should simply not update/create any branches if user "forgot" to specify any refspec.
It seems that Egit asks actually for the passphrase when I do synchronize workspace. Just the clone wouldn't…. (if that makes any sense)
(In reply to comment #1) > It seems that Egit asks actually for the passphrase when I do synchronize > workspace. Just the clone wouldn't…. (if that makes any sense) sorry wrong bug…..
JGit currently does not support the "push.default" configuration option. CGit defaults to "simple" behavior. The default behavior of JGit is "current", which explains the creation of the new branches. Note that "simple" behaves as "current" for triangular workflows. In non-triangular workflows, it adds the safety check to not create new branches.
New Gerrit change created: https://git.eclipse.org/r/136629
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/190662
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/190662 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=2883762219e37dc88d7592b4b8f7d5b115baac04
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/136629 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=504001228ba6a43179a72e56ce03aa217c2bdea4
*** Bug 445491 has been marked as a duplicate of this bug. ***