将仓库移至另一台计算机 [英] Moving repo to another computer
问题描述
我已经将一个回购从计算机A移到了计算机B。我已经验证了等待推送的提交仍在B上,但是整个回购(每个文件)都未上台。我不想添加它们并将其作为提交推送,因为从复制存储库到粘贴之前,我一直没有更改每个文件。当我移动存储库时,只有待提交的提交被推送,没有更改。
I've moved a repo from computer A to computer B. I've verified that the commits waiting to be pushed are still there on B, but the whole repo (every single file) is unstaged. I don't want to add them and push them as a commit because I have not changed every single file from when I copied the repo till I pasted it. When I moved the repo it only had the commits pending to be pushed, not changes.
我见过此问题,但此操作无济于事。
I have seen this question, but it didn't help with this.
推荐答案
在计算机B的复制回购文件夹中,执行
On the copied repo folder of computer B, do
git reset --hard HEAD
如果您只想将提交的代码从A复制到B,但在B,将repo文件夹从A复制到B之后。
if you just want to copy the committed code from A to B but leave behind the local modification on B, after copy the repo folder from A to B.
这篇关于将仓库移至另一台计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!