[英]How can i add an existing visual studio 2019 project to a git repo?
I have a boilerplate project named 'XYZ' structured like this:我有一个名为“XYZ”的样板项目,其结构如下:
-XYZ.Domain
-XYZ.CrossCutting
-XYZ.Application
-XYZ.Backend
-XYZ.Infrastructure
I want to do these steps:我想做这些步骤:
Rename everything to ABC:将所有内容重命名为 ABC:
-ABC.Domain -ABC.CrossCutting -ABC.Application -ABC.Backend -ABC.Infrastructure
Add it to a git repository将其添加到 git 存储库
Push everything.推动一切。
How can I accomplish this using visual studio 2019?如何使用 Visual Studio 2019 完成此任务?
From the solution explorer select your solution and pick Create Git Repository (requires the new Git Tools to be enabled):从解决方案资源管理器 select 中选择您的解决方案并选择创建 Git 存储库(需要启用新的 Git 工具):
Fill in the wizard that pops up:填写弹出的向导:
And you have a reporitory.而且你有一个存储库。 If you don't have a
.gitignore
file yet, I'd pick "local repo", as using one of the other options will immediately commit & push.如果您还没有
.gitignore
文件,我会选择“本地仓库”,因为使用其他选项之一将立即提交和推送。 Then add the ignore file and exclude any items you don't wish to push before pushing to a git service:然后在推送到 git 服务之前添加忽略文件并排除您不想推送的任何项目:
You can do your renames before or after.您可以在之前或之后进行重命名。 Which would be a separate and unrelated question to how to initialize the git repo.
对于如何初始化 git 存储库,这将是一个单独且不相关的问题。
Renaming the project files can easily be done in the solution explorer.重命名项目文件可以在解决方案资源管理器中轻松完成。 Renaming the folder containing each project is trickier.
重命名包含每个项目的文件夹比较棘手。 You need:
你需要:
Then, it will ask you to Push to a Git service.然后,它会要求您推送到 Git 服务。
Follow the prompts to sign in to the service of your choice and choose the project/repo.按照提示登录您选择的服务并选择项目/存储库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.