问题
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