I can execute the following on a command line, where I just want to checkout a feature/* branch, and if the sub module does not have it, I want to checkout master.
$ git submodule foreach 'git checkout feature/test-new-scripts || git checkout master'However, if I execute the same command in a Jenkins pipeline, I get a syntax error.
sh """I get the following error
+ git submodule foreach "git checkout feature/test-new-scriptsI've tried the following syntax, where I just changed the single quotes ('...') in the command itself to double quotes ("..."), to no avail
sh """What is the correct syntax do accomplish what I want to do? TIA