Is there a way to make GitHub Desktop rebase a branch against master?
Asked Answered
D

4

51

When I choose "update from master", it creates a merge commit. I'd rather just have it re-base. Is this possible?

Disfigurement answered 27/5, 2016 at 22:4 Comment(3)
I think one solution can be found here: #4830844Ensile
@BrandonLee I'm not sure they are talking about the same program as him.Juice
It looks like Github Desktop has rebase now.Expostulation
A
29

It does not appear that feature is currently included in GitHub desktop. What I normally do is click on the repository name in the drop-down menu in the top left and then click on "open in terminal". Then just follow the instructions here.


Update:

If you add this to your .gitconfig, GitHub desktop should rebase according to here.

[pull]
    rebase = true

Second Update:

GitHub desktop 2.0 now supports rebasing built in! It is under the branch section of the top menu or you can use the shortcut ⇧⌘E

Arabel answered 27/2, 2018 at 2:37 Comment(2)
You can also use the Ctrl + ` combinationCatastrophism
For GitHub Desktop Version 3.4.1, click on Branch and select Update from main or on keyboard shortcut key Ctrl+Shift+UPrudy
O
10

As @Taraz commented on the question, GitHub Desktop now has the option built in.

Branch > Rebase current branch

It's below the Update from master option

Olodort answered 26/5, 2021 at 15:8 Comment(0)
W
1

Using rebase instead of merging branches results in an easier to follow but less exact history of commits. Your team should agree under what circumstances you should rebase a branch. You should still always merge branches into the main branch through a pull request.

A suggested approach is to allow rebasing local changes that you have made but haven't shared with others, but to merge once you are sharing changes with others. This avoids trouble with rewriting history while still letting you easily catch up with changes as you develop your code locally.

Ref & Source:

Wetmore answered 26/2, 2018 at 5:34 Comment(1)
The suggestion in your quote's second paragraph is exactly what this question is asking how to do in GitHub Desktop - not add a noisey merge commit every time you update unshared local changes against master. I think GitHub Desktop on Windows uses the suggested approach by default but on Mac it doesn'tBlane
G
1

No. There was a feature request on their GitHub issue tracker for exactly this option a year ago, for which the response was

This idea is interesting for the future, but this is beyond the scope of our current roadmap.

Since then, another feature request, which is still open, has also been posted.

Gaytan answered 26/8, 2018 at 15:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.