I'm using NodeJS to execute multiple git command lines. Updating submodules, pulling some projects, etc. Everything works but I have an inconvenient issue. When I perform two command lines, like this
const exec = util.promisify(require('child_process').exec);
await exec('cd my/project/path && git pull');
await exec('cd my/other/project/path && git pull');
I'm forced to enter my SSH key passphrase two times. I tried await exec('cd my/project/path && git pull && cd my/other/project/path && git pull');
but the result is the same (passphrase asked two times).
Is this possible to use the ssh-agent to keep the passphrase between the two command lines? Or any other solution?