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.
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.
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.
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 .
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With