Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to do a Git Pull --rebase with Visual Studio git tools (and can it be set by default)

First, as the title says, is it even possible in a single step (i.e. not fetch then rebase), to do a pull --rebase?

Second, is a setting in Visual Studio to force the built-in Team Explorer git tools to always do a pull --rebase rather than a standard pull (fetch/merge).

I am aware you could set the default in the global or project config files with git config branch.autosetuprebase always, but I wanted to specifically find out if Visual Studio could update/change that setting or had a similar option, like most other GUIs have. I haven't been able to find anything, so it seems like it doesn't, hence the question.

like image 307
LocalPCGuy Avatar asked Apr 01 '15 20:04

LocalPCGuy


People also ask

How do I rebase git in Visual Studio?

Choose Git > Manage Branches to open the Git Repository window. In the Git Repository window, right-click the target branch and select Checkout. Right-click the source branch, and select Rebase <target-branch> onto <source-branch>. Visual Studio will display a confirmation message after a successful rebase.

Does git pull rebase by default?

Pull with RebaseThe default Git behavior is merging, which will create a new commit on your local branch that resolves those changes. This configuration switches that behavior to the rebasing strategy.

Is git pull rebase same as git pull?

This two git commands are not interchangeable. Git pull downloads the newest changes from the remote repository and applies the changes to your local repository. Generally, git pull is git fetch and git merge. Rebasing on the other hand can be a replacement for git merge .


1 Answers

In VS2017 you can use built-in feature to change git settings for rebase: go to Team Explorer -> Home -> Settings -> Global Settings or Repository Settings -> set Rebase local branch when pulling: True (screenshot)

like image 77
Woonder Avatar answered Sep 22 '22 02:09

Woonder