我正在编写 shell 脚本来git
从远程仓库部署一个分支。
这是我正在使用的命令:
git clone -q --depth=1 https://my.repourl.com/git-repo.git /my/destination/folder -b develop
问题是,如果分支(在这种情况下为开发)是错误的,它只是忽略并从主分支中提取(?)。我收到这条消息:
warning: Remote branch devel not found in upstream origin, using HEAD instead
我只想让 git 死/退出,如果它没有找到指定的分支。有什么标志吗?或者有什么替代方案?git-archive
由于某种原因没有工作。