简体   繁体   English

Visual Studio 项目文件和本地 Git 存储库

[英]Visual Studio Project files and the local Git repository

I'm starting to use Git and Git Hub with VS2019.我开始在 VS2019 中使用 Git 和 Git Hub。 However, i am somewhat confused on how my visual studio solution files are stored and what is stored in the local git repository.但是,我对如何存储 Visual Studio 解决方案文件以及存储在本地 git 存储库中的内容有些困惑。

According to this image https://i.stack.imgur.com/gi1RY.png .根据这张图片https://i.stack.imgur.com/gi1RY.png there should be two locations on my local PC where my solution files are stored.我的本地 PC 上应该有两个位置存储我的解决方案文件。 In the "Development workspace" which is under c:\\Dev<Solution name> and in the "local Git Repo" which is C:\\Users<My UserName>\\source\\repos.在 c:\\Dev<Solution name> 下的“开发工作区”和 C:\\Users<My UserName>\\source\\repos 下的“本地 Git Repo”中。

However, when i create a new solution on my workstation the solution location is defaulting to the Repo location C:\\Users<My UserName>\\source\\repos.但是,当我在工作站上创建新解决方案时,解决方案位置默认为 Repo 位置 C:\\Users<My UserName>\\source\\repos。

So that is he only location my code is stored.所以这是他唯一存储我的代码的位置。

If i change the locaton for my solution back to c:\\Dev<Solution name> a .git folder is created in this new locaton.如果我将解决方案的位置更改回 c:\\Dev<Solution name>,则会在此新位置中创建一个 .git 文件夹。 But nothing is created under C:\\Users<My UserName>\\source\\repos.但是在 C:\\Users<My UserName>\\source\\repos 下没有创建任何内容。

Is this right or am i missing the point ?这是正确的还是我错过了重点? There appears to only be one location for my solution files.我的解决方案文件似乎只有一个位置。

Erick埃里克

Yes, a local Git repository and its associated solution files are one and the same - in the same location.是的,本地 Git 存储库及其关联的解决方案文件是一回事 - 位于同一位置。 The solution files are your local copy of the Git repository.解决方案文件您的 Git 存储库的本地副本。

On Visual Stuido 16.8.1, you can change the default location of new projects in:在 Visual Stuido 16.8.1 上,您可以在以下位置更改新项目的默认位置:

Tools > Options > Projects and Solutions > Locations .工具 > 选项 > 项目和解决方案 > 位置

You can also change the default location of new or cloned Git projects in:您还可以在以下位置更改新的或克隆的 Git 项目的默认位置:

Git > Settings > Git Global Settings . Git > 设置 > Git 全局设置

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio在线项目无法识别它具有本地Git存储库? - Visual Studio online project does not recognize that it has local Git repository? Visual Studio Code - 连接到远程 Git 存储库并将本地文件推送到新的远程存储库 - Visual Studio Code - Connect to a remote Git repository and PUSH local files to a new remote repository 自动完成在 git 存储库中的 Visual Studio 项目中不起作用 - Autocomplete not working in Visual Studio project in git repository 将 Visual Studio 项目添加到现有的 git 存储库 - Add a visual studio project to an existing git repository 在 Visual Studio 中将本地项目重新同步到 GitHub 存储库 - Resync local project to GitHub repository in Visual Studio 如何用Visual Studio Online Git存储库均衡Visual Studio 2017本地存储库? - How equalize Visual Studio 2017 local repository with Visual Studio Online Git repository? Visual Studio 2015中存储“本地Git存储库”路径的位置 - Where are “Local Git Repository” path stored in Visual Studio 2015 Visual Studio 2015和GIT-使用本地登台覆盖远程存储库 - Visual Studio 2015 & GIT - Overwrite remote repository with local staging 同一个本地 git 存储库上的多个程序员都使用 Visual Studio - Multiple programmers on same local git repository all using Visual Studio Visual Studio 中的本地 Git 存储库 url 错误:不支持的 URL 协议 - Local Git repository url in Visual Studio error: Unsupported URL protocol
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM