我意外删除了我的git文件夹。我在远程分支机构库工作。 我如何将我的远程分支拉到我的本地?
答案 0 :(得分:3)
如果你还有git repo:
只做
git fetch origin
接着是。
git checkout -b <branch> origin/branch
如果您已完全删除了git存储库 然后重新放行存储库:
git clone <repository-address>
然后,按照上面的步骤获取其他分支,如果他们没有自动拉入。
答案 1 :(得分:0)
我意外删除了我的git文件夹。我在远程分支机构库工作。我如何将我的远程分支拉到我的本地?
检查所需的分支
# Clone the repo
git clone <url>
# Checkout the desired branch
git checkout <branch name>
如果您仍然拥有.git
文件夹并且未将其删除,请阅读如何将代码恢复到此处:
How to move HEAD back to a previous location? (Detached head)
答案 2 :(得分:0)
git checkout -b branch_name
git pull URL branch_name