Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 924
Kushal Dave Avatar asked May 27 '16 22:05

Kushal Dave


People also ask

How do I rebase a branch against a master?

To rebase, make sure you have all the commits you want in the rebase in your master branch. Check out the branch you want to rebase and type git rebase master (where master is the branch you want to rebase on).

How do I rebase a master with a branch in GUI?

In git-gui : Go to Tools -> Add and then enter a custom command i.e. git rebase master . Select Add globally to have this option appear for all repositories.

How do you rebase against a branch?

To rebase a branch, checkout the branch and then rebase it on top of another branch. Important: After the rebase, the applied commits will have a different hash. You should not rebase commits you have already pushed to a remote host.


2 Answers

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

like image 82
Liam R Avatar answered Sep 28 '22 20:09

Liam R


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

like image 6
Justin Avatar answered Sep 27 '22 20:09

Justin