有没有办法从闪存驱动器而不是 Git 推送和拉取项目?

Is there any way to push and pull project from Flash drive instead of Git?

我需要将一个项目从我的本地机器推送到闪存驱动器,然后将这个项目拉到未连接到网络的服务器

是:在您的闪存驱动器上初始化一个裸仓库,然后使用您的普通仓库中的 local protocol file://

cd /path/to/my/repo
git remote add origin file://h/path/to/bare/repo.git

(这里假设h是你的U盘挂载的盘符)

注意:如果您只是偶尔这样做,另一种选择是 use a git bundle