繁体   English   中英

如何将目录粘贴到git存储库中

[英]How to paste a directory into a git repository

所以我有一个git repo,我正在尝试将目录粘贴到其中。 我克隆仓库,签出一个新的分支并将目录粘贴到子目录之一中。 所以文件路径是这样的

Repo/ios/parentDir/directoryPastedIn

当我在parentDir中并执行git分支时,我看到自己在签出的分支中。 当我在directoryPastedIn ,我做了一个git branch ,看到我在master而不是那个分支上。

当我在父目录中处于git状态时,得到了此信息(执行git add -A后)-

# On branch someBranch
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   directoryPastedIn
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   directoryPastedIn (modified content)
#

但是,当我进入directoryPastedIn并进入其中的一些子目录并执行git status ,我看到有未跟踪的文件。 当我将其推送到远程服务器时,我看到已推送了一个二进制文件,而不是目录。

那么,如何将目录粘贴到本地git repo中并进行推送呢?

在我看来,您已粘贴到一个本身包含git存储库的目录中。

检查粘贴的目录是否具有.git子文件夹。 如果是这样,并且如果您不需要该存储库,请删除该.git文件夹。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM