Moving repo to another computer

怎甘沉沦 提交于 2019-12-10 20:35:00

问题


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.


回答1:


On the copied repo folder of computer B, do

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.



来源:https://stackoverflow.com/questions/26021582/moving-repo-to-another-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!