04-Source Control FAQ
04-Source Control FAQ
com/docs/sourcecontrol/faq
TOPICS FAQ
(https://vscode.dev/github/microsoft/vscode-docs/blob/main/docs/sourcecontrol/faq.md)
Git
I initialized my repo but the actions in the ... menu are all grayed out
To push, pull, and sync you need to have a Git origin set up. You can get the required URL from the
repository host. Once you have that URL, you need to add it to the Git settings by running a couple of
command-line actions. For example:
My team is using Team Foundation Version Control (TFVC) instead of Git. What should I do?
Use the Azure Repos (https://marketplace.visualstudio.com/items?itemName=ms-vsts.team) extension and
this will light up TFVC support.
How can I sign in to Git with my Azure DevOps organization that requires multi-factor
authentication?
Git Credential Manager (https://github.com/GitCredentialManager/git-credential-manager) (GCM) is the
recommended Git credential helper for Windows, macOS, and Linux. If you're running Git for Windows,
GCM has already been installed and configured for you. If you're running on macOS or Linux, the GCM
README (https://github.com/GitCredentialManager/git-credential-manager#download-and-install) has
setup instructions.
Another option is to disable the auto fetch feature by changing the following setting: "git.autofetch":
false .
If you try to open such a repository, VS Code will show a welcome view in the Source Control view or an
error notification. Both the welcome view and the notification contain the Manage Unsafe Repositories
command that lets you review the list of potentially unsafe repositories, mark them as safe, and open
them. The Manage Unsafe Repositories command is also available in the Command Palette ( ⇧⌘P ).
Marking a repository as safe will add the repository location to the safe.directory git configuration
(https://git-scm.com/docs/git-config#Documentation/git-config.txt-safedirectory).
On Windows, a common scenario where this can occur is when a repository is cloned using an application
(for example, Windows Terminal or VS Code) that runs "as administrator", but the repository is opened
using another application or instance (for example, VS Code) that does not run "as administrator".
Why isn't VS Code discovering Git repositories in parent folders of workspaces or open files?
VS Code uses git rev-parse --show-toplevel to determine the root of a Git repository. In most cases,
the root of the Git repository is inside the workspace, but there are scenarios where the root of the Git
repository is in the parent folders of the workspace or the open file(s). While opening Git repositories in
parent folders of workspaces or open files is a great feature for advanced users, it can be confusing for
new users. We have seen cases where this confusion resulted in discarding changes from these Git
repositories causing data loss.
To avoid confusion, and to reduce the risk of data loss, VS Code will display a notification and a new
welcome view in the Source Control view, and will not automatically open Git repositories from the parent
folders of workspaces and open files.
You can control how Git repositories from parent folders are handled using the
! (vscode://settings/git.openRepositoryInParentFolders)git.openRepositoryInParentFolders setting. If
you would like to restore the old behavior, set the
! (vscode://settings/git.openRepositoryInParentFolders)git.openRepositoryInParentFolders setting to
always .
Yes, though VS Code works most easily with SSH keys without a passphrase. If you have an SSH key with
a passphrase, you'll need to launch VS Code from a Git Bash prompt to inherit its SSH environment.
GitHub
Yes No
02/06/2025
Follow @code(https://go.microsoft.com/fwlink/?LinkID=533687)
Request features(https://go.microsoft.com/fwlink/?LinkID=533482)
Report issues(https://www.github.com/Microsoft/vscode/issues)
Watch videos(https://www.youtube.com/channel/UCs5Y5_7XK8HLDX0SLNwkd3w)
(https://
www.microsoft.com)
(https://go.microsoft.com/fwlink/?LinkID=533687)
(https://github.com/microsoft/vscode) (https://www.youtube.com/@code)
Support (https://support.serviceshub.microsoft.com/supportforbusiness/create?sapId=d66407ed-3967-
b000-4cfb-2c318cad363d)
Privacy (https://go.microsoft.com/fwlink/?LinkId=521839)
Terms of Use (https://www.microsoft.com/legal/terms-of-use) License (/License)