git - 是否可以通过 gitconfig 或类似方法向 Git 添加其他自定义路径以搜索脚本和命令?
问题描述
我正在尝试设置我的便携式 Git 以在特定文件夹中搜索其他脚本。
考虑这个示例目录树结构
-- my-portable-git
│
├───git-scripts
│ git-myscript
│ ⋮ # some more scripts
└───portable-git
⋮ # rest of files for portable git
由于我无法编辑我的PATH
env 变量$reasons
,是否可以通过.gitconfig
或通过其他方式添加其他路径git
以在调用脚本/命令/等时使用?
参考上面的例子:是否可以说git
“ oi git,请查看文件夹../git-scripts/
以获取更多命令!” 不编辑PATH
环境?
解决方案
是的。设置GIT_EXEC_PATH
环境变量。
请参阅https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
推荐阅读
- ios - swinject 是否重新实例化对象?
- android - 如何从 childfragment 到 parentfragment 获得价值?
- typo3 - TYPO3 v9.5.0 - 错误消息:请求的页面不存在 /robots.txt
- python - 如何在 Google Colab 终端命令中使用 Python 变量?
- php - 如何使用 DOM 和 XPath 推断 iframe 中的文本内容?
- javascript - 指向以 javascript:// 开头的 URL 的链接可以执行任何代码吗?
- python - 在 YOLO 中更改 cfg 和 weight 文件
- r - 由于 EU-GDPR,如何保护/加密 RData 文件中的 R 对象
- excel - 将数据从两个表输入保存到一个 excel 中写入 pentaho
- php - Paypal Checkout 客户端集成对浏览器安全吗?