Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git删除并重命名了dirs_Git_Github - Fatal编程技术网

Git删除并重命名了dirs

Git删除并重命名了dirs,git,github,Git,Github,我有一个文件夹结构: tmpl tmpl3 我删除了tmpl目录,然后将tmpl3重命名为tmpl下一次提交。现在我在本地上有实际的文件夹,但在git上-目录已被删除。Git没有显示要提交的内容 如何修复此问题?Git不理解重命名。当您重命名某个内容时,需要将其从git中删除,然后再次添加 删除和添加目录: git rm --cached tmpl #Doesn't matter if it still exists or not git add tmpl3 git commit 一些命令

我有一个文件夹结构:

  • tmpl
  • tmpl3
我删除了
tmpl
目录,然后将
tmpl3
重命名为
tmpl
下一次提交。现在我在本地上有实际的文件夹,但在git上-目录已被删除。Git没有显示要提交的内容

如何修复此问题?

Git不理解重命名。当您重命名某个内容时,需要将其从git中删除,然后再次添加

删除和添加目录:

git rm --cached tmpl #Doesn't matter if it still exists or not
git add tmpl3
git commit
一些命令,如
git mv
可以帮助您做到这一点:

git mv -r tmpl tmpl3
Git不懂重命名。当您重命名某个内容时,需要将其从git中删除,然后再次添加

删除和添加目录:

git rm --cached tmpl #Doesn't matter if it still exists or not
git add tmpl3
git commit
一些命令,如
git mv
可以帮助您做到这一点:

git mv -r tmpl tmpl3

git add tmpl,然后git commit-m“有意义的消息”,git push origin mastergit add tmpl,然后git commit-m“有意义的消息”,git push origin master