简体   繁体   English

git checkout在Windows 7上下载的文件

[英]git checkout downloaded files on Windows 7

My network from work doesn't let me clone any repository via Windows Git tool by command line git clone therefore I just download the repository. 我的工作网络不允许我通过命令行git clone通过Windows Git工具克隆任何存储库,因此我只是下载该存储库。

My problem now is, I need to checkout by git checkout ###### but I cannot figure out how I can do that on my Windows 7. I have installed GitBash tool and Git Desktop, but as I said my network doesn't allow me to do much. 我现在的问题是,我需要通过git checkout ######进行检出,但是我无法弄清楚如何在Windows 7上执行该操作。我已经安装了GitBash工具和Git Desktop,但是正如我所说的,我的网络没有不要让我做很多事。

Option 1: local clone 选项1:本地克隆

Making a local clone should be your easiest option: it does not involve clone anything from the web so your administrator rules might allow it. 进行本地克隆应该是最简单的选择:它不涉及从Web克隆任何内容,因此您的管理员规则可能允许这样做。

I'll assume you downloaded the remote into workspace/downloaded-bare.git : 我假设您workspace/downloaded-bare.git遥控器下载到workspace/downloaded-bare.git

cd workspace
git clone downloaded-bare.git sandbox

now you should be ready to work in workspace/sandbox . 现在您应该已经可以在workspace/sandboxworkspace/sandbox

Option 2: turn the bare into a working sandbox 选项2:将裸露的内容变成可用的沙箱

If the local clone does not work, you can do the equivalent steps manually: 如果本地克隆不起作用,则可以手动执行等效步骤:

mkdir sandbox
cp -ar downloaded-bare.git sandbox/.git
cd sandbox
git init

and again, sandbox is now ready for normal work. 同样, sandbox现在可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM