git - 无法在子模块根目录之外调用 git 函数是 git 子模块功能还是错误?
问题描述
git submodule foreach 'if echo "$sm_path" | grep just_this_one ; then git rev-parse HEAD ||:; fi'
- 给出:just_this_one 的 sha1
git submodule foreach 'if echo "$sm_path" | grep just_this_one ; then cd somewhere; git rev-parse HEAD ||:; fi'
- 给出:错误不是存储库'.git'
git submodule foreach 'if echo "$sm_path" | grep just_this_one ; then cd somewhere; git -C .. rev-parse HEAD ||:; fi'
- 给出:just_this_one 的 sha1
这是错误还是功能?
如果我想运行这个命令,我该怎么做才能通过它:
git submodule foreach 'make -C somewhere all'
makefile 包含一些 git 函数调用。我还希望仍然能够在 git submodule foreach 之外调用 makefile。
$ git --version
git version 2.23.0
解决方案
推荐阅读
- tensorflow - TensorFlow,Julia - 张量和浮点数
- android - GSON:使用有时对象和有时数组解析 JSON 键值
- php - 在上传到 Amazon S3 存储桶时调整图像大小
- android - 无法在 Eddystone-TLM 中添加 extraDataField
- mysql - 使用 php 备份 MySQL 数据库(最好是 PDO)
- mysql - MySQL str_to_date() 函数失败,年份从星期一开始
- python - Python生成器链接是指最后一次迭代
- c# - XAML PasswordBox 在初始化期间抛出 InvalidCastException
- python - Python list() 没有正确创建字典列表
- visual-studio-code - 无法在 VS Code 中安装“Dart-Code.flutter”