用于验证github凭据的Shell脚本
我有shell脚本,我正在将主分支克隆到某个目录中。但是,一旦我在指定目录中成功克隆了主分支,我还有其他步骤要执行。下面的命令是否会返回一些true | false,以便我执行其他步骤用于验证github凭据的Shell脚本,git,shell,github,Git,Shell,Github,我有shell脚本,我正在将主分支克隆到某个目录中。但是,一旦我在指定目录中成功克隆了主分支,我还有其他步骤要执行。下面的命令是否会返回一些true | false,以便我执行其他步骤 git clone -b master https://github.com/someuser/project.git /path/to/dir 我有其他办法,但想知道是否有这种可能性 谢谢 git clone命令成功时使用退出代码0,失败时使用非零, 就像任何表现良好的程序一样。 您可以在条件语句中使用此选
git clone -b master https://github.com/someuser/project.git /path/to/dir
我有其他办法,但想知道是否有这种可能性
谢谢 git clone命令成功时使用退出代码0,失败时使用非零, 就像任何表现良好的程序一样。 您可以在条件语句中使用此选项,例如:
if git clone -b master repourl /path/to/dir; then
# clone successful -> run setup script
else
echo fatal: could not clone repo
fi