Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Setting Default Remote Branch Destination(Setting Original Remote Branch Destination)
Setting Default Remote Branch Destination [message #1855236] Mon, 03 October 2022 11:46 Go to next message
Eclipse UserFriend
If I am on Branch1 and rebase that branch on top of Branch2, when I go to push the Branch1 back to the remote, the destination branch is set to Branch2 instead of Branch1 as expected.

I would expect Branch1 since it contains all of the Branch2 changes and the Branch1 changed, so wouldn't want to automatically overwrite Branch2 on the remote.

Is there an option to set it so the original source branch (Branch1 in above example) is still selected in the "Push to branch in remote" => "Destination" => "Branch" field?

Thanks!
Nick

[Updated on: Mon, 03 October 2022 16:31] by Moderator

Re: Setting Default Remote Branch Destination [message #1855246 is a reply to message #1855236] Tue, 04 October 2022 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Select the branch in the repositories view and click "Configure branch", and select the "Upstream Branch".
The is used to determine the destination branch of a push request if this branch is checked out.
Re: Setting Default Remote Branch Destination [message #1855248 is a reply to message #1855246] Tue, 04 October 2022 07:35 Go to previous message
Eclipse UserFriend
Thanks for the reply, that would only change it for the branch I'm currently on though, correct? It would not automatically select the branch you're on as remote?

I was wondering specifically about after rebasing a branch, the destination branch showing the source branch instead of the original destination.

Here's the procedure we follow:
BranchA is our main branch
Create BranchB from BranchA
Do work and commit to BranchB
If you use the "Push branch 'BranchB'" option at this point the destination branch automatically populates with BranchB as expected, so if you push it, it'll create a remote BranchB.
Let's say there's a merge conflict now, so we need to rebase BranchB on to BranchA. When we complete the rebasing and use "Push branch 'BranchB'" the destination branch now auto populates to BranchA as the remote destination branch.

It that some egit or git sets? Is there a way to automatically have that select BranchB instead of BranchA for the destination branch?
Previous Topic:git diff and jgit-cli diff have different results
Next Topic:'Checkout this version' on files in a Stash issues with new or deleted files
Goto Forum:
  


Current Time: Sat May 24 22:26:59 EDT 2025

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

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

Back to the top