简体   繁体   English

将repo移动到另一台计算机

[英]Moving repo to another computer

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. 我已经将计算机A的回购移动到了计算机B.我已经验证了等待推送的提交仍然存在于B上,但是整个存储库(每个文件)都是未分级的。 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. 我不想添加它们并将它们作为提交推送,因为我没有更改每个文件,因为我复制了repo直到我粘贴它。 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. 我已经看到了这个问题 ,但它没有帮助。

On the copied repo folder of computer B, do 在计算机B的复制repo文件夹上,执行

git reset --hard HEAD

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. 如果您只想将提交的代码从A复制到B,但在将repo文件夹从A复制到B后,在B上留下本地修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM