I have shell script and I am cloning master branch into some directory. However I have other steps to follow once I successfully cloned master branch in specified directory. Is there anyway with below command that it returns something true|false so I can do other steps?
git clone -b master https://github.com/someuser/project.git /path/to/dir
git clone command uses exit code 0 on success and non-zero on failure,
just like any well-behaving program.
You can use this in conditional statements, for example:
if git clone -b master repourl /path/to/dir; then # clone successful -> run setup script else echo fatal: could not clone repo fi