简体   繁体   English

映射的Windows驱动器中的Git工作树

[英]Git working tree in mapped windows drive

I have a windows machine setup with a something like this: 我有一个类似这样的Windows机器安装程序:

N:\path\to\dir\project1.git
N:\path\to\dir\running_dir

where N: is a mapped network drive . 其中N:映射的网络驱动器

I'm trying to automatically checkout project1.git in my running_dir upon pushing to project1.git . 我想结帐自动project1.gitrunning_dir后推到project1.git I have followed this post on exporting GIT_WORK_TREE ; 我已经关注了这篇关于导出GIT_WORK_TREE的文章 however, I am confused on what path to use in my post-receive hook: 但是,我对在post-receive挂钩中使用什么路径感到困惑:

#!/bin/sh
GIT_WORK_TREE= ????????
export GIT_WORK_TREE
git checkout -f

Suppose that N: maps to C:\\a\\b on the remote windows machine. 假设N:映射到远程Windows机器上的C:\\a\\b

Currently trying: /c/a/b/path/to/dir/running_dir 当前正在尝试: /c/a/b/path/to/dir/running_dir

edit : Also trying: 编辑 :也尝试:

git --work-tree=/c/a/b/path/to/dir/running_dir checkout -f

and getting: fatal: this operation must be run in a work tree 得到: fatal: this operation must be run in a work tree

Adding absolute paths weren't working - regardless what I tried. 添加绝对路径不起作用-不管我尝试了什么。 Easily fixed by supplying a relative path to --work-tree though 通过提供--work-tree的相对路径轻松修复

Run bash-shell in N:\\path\\to\\dir\\running_dir , in which perform pwd . N:\\path\\to\\dir\\running_dir中运行bash-shell,在其中执行pwd

Output of this command will be path, translated for bash 该命令的输出将是路径,已翻译为bash

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

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