In Visual Studio 2022 version 17.2, we changed the "Preserve" setting to "Merges" to match a recent update from Git. Merges: Rebase without flattening locally created merge commits. Unset (default): Unless specified in other configuration files, merge the current branch into the upstream branch. True: Rebase current branch on top of upstream branch after fetch.įalse: Merge the current branch into the upstream branch. This setting is available at both global and repository scopes, and corresponds to the git config pull.rebase setting. Rebasing sets aside the changes made by commits in the current branch that are not in the upstream branch, resets the current branch to the upstream branch, then applies the changes that were set aside. Set Prune remote branches during fetch to True (recommended). Go to Git Global Settings to configure this option at the global level go to Git Repository Settings to configure this option at the repo level. Valid settings are, as follows:įrom the Git menu, go to Settings. We recommend setting this option to True at the global level. This setting is available at both global and repository scopes, and corresponds to the git config fetch.prune setting. Pruning removes remote-tracking branches that no longer exist on the remote and helps you keep your branches list clean and up to date. Provide your user name and email, then choose OK to save. To set your user name and email at the global level, go to Git Global Settings to set your user name and email at the repository level, go to Git Repository Settings. This setting is available at both global and repository scopes, and corresponds to the git config user.name and user.email settings.įrom the Git menu, go to Settings. The name and email that you provide will be used as the committer information for any commit you make. To configure Git settings not exposed in Visual Studio, use the git config command to write a value to your configuration files: git config section.key value.
For more information about Git configuration, see the Pro Git chapter on customizing Git, the git-config documentation, and the Pro Git reference on configuration files. Git settings configured in Visual Studio's Global Settings correspond to settings in Git's user-specific configuration file, and the settings in Repository Settings correspond to settings in the repository-specific configuration file. You can view and modify the following settings in Visual Studio, even though they are managed by Git configuration files. You can also configure and check some of the most common Git configuration settings. After configuring your desired settings, select OK to save the updated settings. You can configure several common Git settings, as described in the following sections of this article. To configure Git settings in Visual Studio, choose Settings from the top-level Git menu.Ĭhoose Git Global Settings or Git Repository Settings to view and configure global-level or repository-level settings.
Applies to: Visual Studio Visual Studio for Mac Visual Studio Code