繁体   English   中英

针对系统中其他位置的存储库运行“ git status”

[英]Running “git status” against a repository located elsewhere in the system

我知道我可以这样做:

git --git-dir="Z:/www/proj/web/test/sample-repo-cloned/.git" status

但是,问题在于该命令是从proj文件夹运行的,这意味着还将考虑sample-repo-cloned前的所有文件。

有没有办法在sample-repo-cloned文件夹的范围内运行此命令?

您应该能够指定工作树以及git目录:

--work-tree

即:

git --work-tree="Z:/www/proj/web/test/sample-repo-cloned/" --git-dir="Z:/www/proj/web/test/sample-repo-cloned/.git"  status

结果应该在工作树根目录的本地。

(cd Z:/www/proj/web/test/sample-repo-cloned ; git status)

暂无
暂无

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

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