Sandor Hadas <sandorhadas...@gmail.com> writes:
> However, if the very same script is added to cron then what happens:
> 1. Cron starts the script
> 2. Script invokes git clone
> 3. git clone spawns several "git-remote-https" processes
> 4. git returns while the spawned processes run
> 5. Commands based on the repo fail (if I add a sleep 30 before running the
> commands then success, but that cannot be the right path)
> How do I make sure that a git clone is actually complete when running from
> cron OR how do I make git run synchronously so that it does not return
> control to the bash before it is really done (nohup did not work because of
> the detached spawns)?
Looking at the Stack Overflow question, you put an "&" after the git
clone, which means that execution of the script should continue without
waiting for the git clone to finish. If you want to wait for git clone
to finish, just don't put the "&" there. (If it is followed on the same
line by another command, change "&" to ";".)
Yes, git clone starts git-remote-http processes, but git clone won't
exit until the git-remote-http processes exit.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.