Git更改repo目录和文件目录 [英] Git changing repo directory and files directory

查看:587
本文介绍了Git更改repo目录和文件目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最终将我的git repo移动到另一个目录以及所有文件的更改目录。

现在,当我将文件添加到索引并提交它时,它就像提交一个新文件而不提交差异一样。尽管当我在Git Extension中提取历史记录时,所有的历史记录都在那里,最近的提交仍然附加到master,就好像什么都没有发生一样。



可能是我不知道git如何工作,它是如何工作的?建议?或者任何需要我澄清的人? 解决方案

不要忘记 Git使用启发式执行重命名检测



这意味着,正如我在git status 显示重命名但不正确,即:


  • a git add 可能会考虑将文件添加到索引中的新文件
  • 但是 git commit 应该协调该文件的状态,并将其显示为正在移动。



因此,检查(当你准备好提交时) git commit 的输出,看看新文件状态是否持续。 p>

I end up moving my git repo to another directory and also the change directory of all my files.

Now when I add file to index and commit it, it acts as if it is committing a new file and not committing the difference. Eventhough when I pull up the history in Git Extension, all the history is there, and the most recent commit is still appending to the master as if nothing ever happen.

Probably I don't know enough how git to works that it is how it's suppose to work? Suggestions? or anyone need me to clarify?

解决方案

Don't forget that Git performs rename detection using a heuristic

That means, as I explained in "git status shows rename but it's incorrect", that:

  • a git add alone might consider the file added to the index a "new" file
  • but a git commit should reconcile the state of that file, and display it as being moved.

So check (when you are ready to commit) the output of a git commit, to see if the "new" file status persists.

这篇关于Git更改repo目录和文件目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆