Closed ScottRFrost closed 6 days ago
I've checked the implementation for Update from [default branch]
feature of Github Desktop. From the perspective of its code, it only performs a merge operation:
private updateBranchWithContributionTargetBranch() {
const { selectedState } = this.state
if (
selectedState == null ||
selectedState.type !== SelectionType.Repository
) {
return
}
const { state, repository } = selectedState
const contributionTargetDefaultBranch = findContributionTargetDefaultBranch(
repository,
state.branchesState
)
if (!contributionTargetDefaultBranch) {
return
}
this.props.dispatcher.initializeMergeOperation(
repository,
false,
contributionTargetDefaultBranch
)
const { mergeStatus } = state.compareState
this.props.dispatcher.mergeBranch(
repository,
contributionTargetDefaultBranch,
mergeStatus
)
}
You can simply run this option in SourceGit by select the default branch and use mouse right click to open context menu, then you will find a menu item to merge the default branch into current. For example:
Yeah, that's all it does. It's just a shortcut to do it easily.
Recently upgraded to SourceGit after years of using GitHub Desktop. The only thing I really miss is that in GitHub Desktop if your currently checked out branch is other than the primary for the repo, there is a menu option under branch for "Update from main/master" that was a quick way to make sure your branch was up to date from main/master.
Please consider adding something similar to SourceGit! Thanks in advance!