我意外删除了我的 git 文件夹。我正在远程分支存储库工作。 如何将远程分支拉到本地?
如果您还有 git 存储库:
就做吧
git fetch origin
其次是。
git checkout -b <branch> origin/<branch>
如果您已经完全删除了 git 存储库 然后重新克隆存储库:
git clone <repository-address>
然后,如果其他分支没有自动拉入,请按照上述步骤获取其他分支。
我意外删除了我的 git 文件夹。我正在远程分支存储库工作。如何将远程分支拉到本地?
查看所需的分支
# Clone the repo
git clone <url>
# Checkout the desired branch
git checkout <branch name>
如果您仍然有
.git
文件夹并且没有将其删除 - 请阅读如何在此处获取代码:git checkout -b branch_name
git pull URL branch_name
git clone -b <branch_name> <url>