【发布时间】:2014-11-06 04:15:48
【问题描述】:
我尝试通过传递用户名、密码来克隆 git 存储库。那是成功的。
但我的意图是我想知道 git clone 命令是否执行。 如果没有,我想在 shell 脚本本身中处理此类错误。
我的工作 shell 脚本:
cd ..
git clone https://username:password@bitbucket.org/username/repositoryname.git
cd repositoryname
git checkout branchname1
cd ..
mv repositoryname newfoldername
git clone https://username:password@bitbucket.org/username/respositoryname.git
cd repositoryname
git checkout branchname2
cd ..
mv repositoryname newfoldername
如何在脚本中测试这些步骤是否成功?
【问题讨论】: