You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using default settings, Git repositories are discovered based on the workspace folders, and parent folders of the opened files. There are scenarios in which the Git repository root is in one of the parent folders of the workspace, opened file(s). This is a valuable feature as it allows users to open a subfolder of a Git repository yet have the ability to perform source control operations.
Unfortunately, we have seen that this behaviour can also cause confusion. One such scenario is when one opens a loose file in the home folder, and there is a Git repository in the home directory. In this case the repository from the home directory and can cause confusion as there are lots of changes in the "Source Control" view. Also discarding those changes results in data loss.
This milestone we have introduced a new setting, git.openRepositoryInParentFolders to control how repositories in parent directories are opened.
Pre-requisites
Install the latest version of VS Code Insiders
Ensure that the following settings are set to their default value:
git.autoRepositoryDetection to true
git.openRepositoryInParentFolders to prompt
Setting
Open VS Code Insiders
Open the settings editor and find the git.openRepositoryInParentFolders setting
Review the description or the setting and the options and let me know whether the descriptions are clear
Always
Open VS Code Insiders
Open settings editor and set git.openRepositoryInParentFolders to always
Clone the microsoft/vscode repository and open the extensions/git folder
Switch to the "Source Control" view
Confirm that the microsoft/vscode repository appears
Never
Open VS Code Insiders
Open settings editor and set git.openRepositoryInParentFolders to never
Clone the microsoft/vscode repository and open the extensions/git folder
Switch to the "Source Control" view
Confirm that no notification is being shown
Confirm that you are shown a welcome view informing you that a repository was found in the parent folders
Confirm that clicking on the link in the welcome view opens the Settings editor at git.openRepositoryInParentFolders
Prompt (loose file)
Open VS Code Insiders
Open settings editor and set git.openRepositoryInParentFolders to prompt
Clone the microsoft/vscode repository and open a loose file (ex: extensions/git/src/main.ts)
Confirm that a notification is shown that a git repository was found in the parent folders
Review the text in the notification and the options and let me know if there is any confusion
Open a "Source Control" view
Confirm that you are shown a welcome view informing you that a repository was found in the parent folders
Prompt (folder/workspace)
Open VS Code Insiders
Open settings editor and set git.openRepositoryInParentFolders to prompt
Clone the microsoft/vscode repository and open the extensions/git folder
Confirm that a notification is shown that a git repository was found in the parent folders
Open the "Source Control" view and click on the "Operation Repository" command
Confirm that a quick pick is opened showing the correct path of the git repository
Pick the git repository and press ENTER
Confirm that the microsoft/vscode repository appears
Close the folder
Open the extensions/github folder
Confirm that no notification is being shown
Open a "Source Control" view
Confirm that the microsoft/vscode repository appears
Prompt (aways)
Open VS Code Insiders
Open settings editor and set git.openRepositoryInParentFolders to prompt
Clone the microsoft/vscode repository to a separate folder (ex: vscode1) and open the extensions/git folder
Confirm that a notification is shown that a git repository was found in the parent folders
Choose "Always" in the notification
Confirm that a quick pick is opened showing the correct path of the git repository
Pick the git repository and press ENTER
Switch to the "Source Control" view
Confirm that the microsoft/vscode repository appears
Open the Settings Editor and find the git.openRepositoryInParentFolders setting
Confirm that the value has been updated to "Always"
The text was updated successfully, but these errors were encountered:
Nit: If I press the "Always" button on the notification for the "Prompt (always)" steps, the SCM viewlet automatically loads the repository. There is no quickpick for me to choose a repository from. I'm guessing this is because I only have one parent repository for the open file?
Refs: #169256
Complexity: 5
Create Issue
Using default settings, Git repositories are discovered based on the workspace folders, and parent folders of the opened files. There are scenarios in which the Git repository root is in one of the parent folders of the workspace, opened file(s). This is a valuable feature as it allows users to open a subfolder of a Git repository yet have the ability to perform source control operations.
Unfortunately, we have seen that this behaviour can also cause confusion. One such scenario is when one opens a loose file in the home folder, and there is a Git repository in the home directory. In this case the repository from the home directory and can cause confusion as there are lots of changes in the "Source Control" view. Also discarding those changes results in data loss.
This milestone we have introduced a new setting,
git.openRepositoryInParentFolders
to control how repositories in parent directories are opened.Pre-requisites
git.autoRepositoryDetection
totrue
git.openRepositoryInParentFolders
toprompt
Setting
git.openRepositoryInParentFolders
settingAlways
git.openRepositoryInParentFolders
toalways
Never
git.openRepositoryInParentFolders
tonever
git.openRepositoryInParentFolders
Prompt (loose file)
git.openRepositoryInParentFolders
toprompt
Prompt (folder/workspace)
git.openRepositoryInParentFolders
toprompt
Prompt (aways)
git.openRepositoryInParentFolders
toprompt
vscode1
) and open the extensions/git foldergit.openRepositoryInParentFolders
settingThe text was updated successfully, but these errors were encountered: