Git Local Checkout by replacing .git folder in project directory
I am using Git for my version control. I 开发者_高级运维am currently working with a friend on a project, but I want to get all of the changes he made, and ignore all the files I had, but I want to do that locally. That is, I want to have a local fresh checkout, without using our svn server.
I have replaced my .git folder in the project folder with his. What Git command should I use to checkout everything from .git folder and replace all my code?
Please try git reset --hard
or git checkout --force
A better way to handle this would be to have your friend send you a git bundle
git bundle create repo.bundle master # Refs go here
then he sends you the bundle
git bundle verify repo.bundle
git fetch repo.bundle master:newmaster
git checkout newmaster
And you will have his master as it currently stands, and are even able to compare it against your previous work in master.
精彩评论