添加单独的目录/项目/文件到Git仓库 [英] Add Separate Directories/Projects/Files to Git Repository

查看:106
本文介绍了添加单独的目录/项目/文件到Git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有这种类型的结构:

项目/代码文件 C:\ myCode



Git存储库 C:\ Users \User1\MyGitRepoDir

如何将 myCode 代码目录放入 MyGitRepoDir 以便我可以提交文件等?

解决方案

我能想到的三个选项:


  1. 将myCode中的代码复制到MyGitRepoDir中


  2. 在myCode中使用 git init


  3. 的新git仓库将工作目录。如果你不知道自己在做什么,可能不想这样做。


需要更多详细信息提供建议。 MyGitRepoDir中是否有代码?他们需要在相同的回购?每个文件夹是否需要保留在各自的目录中?


Say I have this type of structure:

Project/Code files: C:\myCode

Git Repository: C:\Users\User1\MyGitRepoDir

How do I get my myCode code directory into MyGitRepoDir so that I can commit files, etc?

解决方案

Three options that I can think of:

  1. Copy paste the code from myCode into MyGitRepoDir

  2. Create a new git repo in myCode with git init

  3. Move the working dir of MyGitRepoDir. Probably don't want to do this if you don't know what you are doing.

Would need more details to provide a recommendation. Is there already code in MyGitRepoDir? Do they need to be in the same repo? Does each folder need to stay in their respective directories?

这篇关于添加单独的目录/项目/文件到Git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆