添加单独的目录/项目/文件到Git仓库 [英] Add Separate Directories/Projects/Files to Git Repository
问题描述
项目/代码文件: C:\ myCode
Git存储库: C:\ Users \User1\MyGitRepoDir
如何将 myCode
代码目录放入 MyGitRepoDir
以便我可以提交文件等?
我能想到的三个选项:
-
将myCode中的代码复制到MyGitRepoDir中
-
在myCode中使用
git init
-
的新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:
Copy paste the code from myCode into MyGitRepoDir
Create a new git repo in myCode with
git init
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屋!