[英]How to re-create my local git repository from GitHub
I had a git repository on my hard drive, but had to replace my hard drive and lost my repository. 我的硬盘驱动器上有一个git存储库,但不得不更换硬盘驱动器并丢失了我的存储库。 I have the repository on GitHub, and I used to
git push origin master
from my local repository. 我在GitHub上有存储库,并且我以前从本地存储库
git push origin master
。
How do I get my repository back from GitHub and get back to where I was? 如何从GitHub取回我的存储库,然后回到原来的位置?
You can simply clone the repository , and you will be back to the last pushed version: 您可以简单地克隆存储库 ,然后返回到上一个推送版本:
git clone https://github.com/username/repository.git
By default, the master branch will be checked out. 默认情况下,将检出master分支。
Use git clone: If you had any non-pushed local changes they will be gone. 使用git clone:如果您有任何未经推送的本地更改,它们将消失。
http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository http://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.