Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.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/0/jpa/2.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和IntelliJ IDEA中的不同文件夹名称_Git_Intellij Idea - Fatal编程技术网

Git和IntelliJ IDEA中的不同文件夹名称

Git和IntelliJ IDEA中的不同文件夹名称,git,intellij-idea,Git,Intellij Idea,我在IntelliJ IDEA中开发了一个项目,并将Git用作VCS。我在IDEA中有一个包“货币”,但在Git中它被称为“货币” 不知怎的,Git知道它是同一个文件夹,但IDEA却不知道。这种不匹配会产生很多问题。如何使此文件夹在Git和IDEA中的名称相同?告诉Git显式重命名目录。 尝试使用-n键查看结果。在源路径参数中使用*,而不是在目标中使用 git mv -f -n path/to/Currencies/* path/to/currencies/ 一旦一切都如您所愿,在不使用-n的

我在IntelliJ IDEA中开发了一个项目,并将Git用作VCS。我在IDEA中有一个包“货币”,但在Git中它被称为“货币”

不知怎的,Git知道它是同一个文件夹,但IDEA却不知道。这种不匹配会产生很多问题。如何使此文件夹在Git和IDEA中的名称相同?

告诉Git显式重命名目录。 尝试使用
-n
键查看结果。在源路径参数中使用
*
,而不是在目标中使用

git mv -f -n path/to/Currencies/* path/to/currencies/
一旦一切都如您所愿,在不使用
-n
的情况下运行相同的程序:

git mv -f path/to/Currencies/* path/to/currencies/
现在签出任何其他版本,然后再次签出此版本。文件夹应重命名为小写

问题的原始路径示例: 准备一个示例:

➜  git_mv_uppercase git:(master) mkdir src
➜  git_mv_uppercase git:(master) mkdir src/Currencies
➜  git_mv_uppercase git:(master) echo "1">src/Currencies/1
➜  git_mv_uppercase git:(master) echo "2">src/Currencies/2
➜  git_mv_uppercase git:(master) ✗ git add --all
➜  git_mv_uppercase git:(master) ✗ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
    new file:   src/Currencies/1
    new file:   src/Currencies/2

➜  git_mv_uppercase git:(master) ✗ git commit -m'uppercase'
Git已经跟踪了重命名(但它还不会重命名工作树中的文件夹)

现在签出到其他版本并返回:

➜  git_mv_uppercase git:(master) git checkout HEAD^
➜  git_mv_uppercase git:(master) git checkout master
我们可以看到文件夹已成功重命名:

➜  git_mv_uppercase git:(master) ls src
сurrencies
告诉Git显式重命名目录。 尝试使用
-n
键查看结果。在源路径参数中使用
*
,而不是在目标中使用

git mv -f -n path/to/Currencies/* path/to/currencies/
一旦一切都如您所愿,在不使用
-n
的情况下运行相同的程序:

git mv -f path/to/Currencies/* path/to/currencies/
现在签出任何其他版本,然后再次签出此版本。文件夹应重命名为小写

问题的原始路径示例: 准备一个示例:

➜  git_mv_uppercase git:(master) mkdir src
➜  git_mv_uppercase git:(master) mkdir src/Currencies
➜  git_mv_uppercase git:(master) echo "1">src/Currencies/1
➜  git_mv_uppercase git:(master) echo "2">src/Currencies/2
➜  git_mv_uppercase git:(master) ✗ git add --all
➜  git_mv_uppercase git:(master) ✗ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
    new file:   src/Currencies/1
    new file:   src/Currencies/2

➜  git_mv_uppercase git:(master) ✗ git commit -m'uppercase'
Git已经跟踪了重命名(但它还不会重命名工作树中的文件夹)

现在签出到其他版本并返回:

➜  git_mv_uppercase git:(master) git checkout HEAD^
➜  git_mv_uppercase git:(master) git checkout master
我们可以看到文件夹已成功重命名:

➜  git_mv_uppercase git:(master) ls src
сurrencies

我发现了一个相当丑陋的解决方案:只创建了一个新文件夹“ccys”,并将所有类从货币复制到ccys。然后删除了代码中的货币和固定导入。

我发现了一个相当糟糕的解决方案:只创建了一个新文件夹“ccys”,并将所有类从货币复制到ccys。然后删除代码中的货币和固定进口。

可能有几个因素在起作用,其中之一是操作系统的大小写敏感度。你在用什么操作系统?Git是否以不区分大小写的方式配置?请尝试在Git中重命名文件夹。可能有几个因素在起作用,其中之一是操作系统的大小写敏感度。你在用什么操作系统?Git是以不区分大小写的方式配置的吗?尝试
Git mv
重命名Git中的文件夹。实际上它试图将src/currences的内容放入src/currences/currences,这不是我想要的do@Vadim我昨天犯了一个错误。第二个path参数中没有
*
。检查这个例子,它应该工作得很好。@Vadim那么,它工作了吗?您是否以这种方式重命名了文件?实际上,它试图将src/currences的内容放到src/currences/currences,这不是我想要的do@Vadim我昨天犯了一个错误。第二个path参数中没有
*
。检查这个例子,它应该工作得很好。@Vadim那么,它工作了吗?您是否以这种方式重命名了文件?