简体   繁体   English

如何在 Visual Studio 中通过 Git 将项目移动到另一个文件夹

[英]How to move a project to another folder by Git in Visual Studio

I have solution that looks like this in Visual Studio and I committed them in Git:我在 Visual Studio 中有这样的解决方案,我在 Git 中提交了它们:

--project.a
--project.b

How should I move them (to for example srcFolder ) to look like the following without loosing Git history:我应该如何在不丢失 Git 历史记录的情况下将它们(例如srcFolder )移动到如下所示:

--srcFolder
  ---project.a
  ---project.b

as mentioned here正如这里提到的

CMD and PowerShell does not expand globing characters, use git bash instead CMD 和 PowerShell 不扩展通配符,请改用 git ZD574D4BB40C848617691A694A99CCEC9

git mv project.a srcFolder

should work then.那么应该工作。

Apparently " Git will automatically detect the move/rename if your modification is not too severe. ".显然“ 如果您的修改不太严重,Git 将自动检测移动/重命名。 ”。

Note the very important comment to that answer by marczych that if you first stage the changes they will then show up as a move.请注意marczych对该答案的非常重要的评论,即如果您首先进行更改,那么它们将显示为移动。

(This operation worked fine in Visual Studio 2019.) (此操作在 Visual Studio 2019 中运行良好。)

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

相关问题 Git 将项目移动到另一个文件夹 - Git Move Project to Another Folder 如何在 Visual Studio 中将项目从 Git 移动到 TFS - How to move a project from Git to TFS in Visual Studio 将 git 项目移动到文件夹中 - Move git project into folder 如何将现有的 Visual Studio 解决方案从 TFVC 项目移动到 Azure DevOps 上的 Git 项目? - How to move an existing Visual Studio solution from TFVC project to Git project on Azure DevOps? 在 Visual Studio 中将项目从根解决方案文件夹移动到子文件夹 - Move Project From Root Solution Folder to Subfolder in Visual Studio 如何在 Visual Studio Online 中将项目从 TFS 移动到 Git? - How do I move a Project from TFS to Git in Visual Studio Online? 如何在visual studio git中显示文件夹的历史记录 - how to show history of a folder in visual studio git Visual Studio 2013 git clone将项目文件放在错误的文件夹中 - visual studio 2013 git clone puts project files in wrong folder 将本地VS项目GIT移至Team visual Studio在线项目GIT - Move local VS project GIT to Team visual studio on-line project GIT 将git项目从一个Visual Studio Online帐户移动到另一个Visual Studio在线帐户 - move a git project from one Visual Studio Online account to a different Visual Studio online account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM