我有一个 bitbucket 存储库,具有以下结构:
Directory-A->
directory a
directory b
file a
file b
file c
现在我想将文件“b”和文件“c”移动到“目录a”
当我在本地机器上执行并通过 git add 提交时。 我在目录 a 中得到文件 b 和文件 c,但它们仍然存在于目录之外。
最佳答案
When I do it on local machine and commit this by git add. I get file b and file c in directory a but they still exists outside it.
那是因为你在 directory a
中执行了 git add .
而不是 Directory- 中的
.git add -A .
A
首先,当您执行 git add -A
(这是一个 git add -u
+ git add .
) 从根文件夹:
Directory-A-> <====== there: git add -A .
directory a
file b
file c
directory b
file a
Directory-A
中的 'git add -A .
' 将检测 Directory-A
中那些文件的删除及其添加在目录a
中。
关于git - 如何更新git中的目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30801637/