4

I have a program that gathers information and checks the result into git.

I need to run the program several times, with each invocation writing to a separate top-level directory, e.g.

pgm --output=$REPO/a
pgm --output=$REPO/b
pgm --output=$REPO/c

Each invocation will modify the state under its output directory, add, commit, and push.

I would like to run these simultaneously.

pgm --output=$REPO/a &
pgm --output=$REPO/b &
pgm --output=$REPO/c &

Are there any concurrency issues I should be concerned with?

Mark Harrison
  • 283,715
  • 120
  • 322
  • 449

1 Answers1

1

Git has no problem doing things in parallel or in script.

If the git is in a middle of any operation it will automatically lock itself to reduce any option of data corruption.

So the answer to your question is simple: you can do it without any concerns.
Another related question is this:

Is it safe if more git commands are run on the same repo in parallel?

Community
  • 1
  • 1
CodeWizard
  • 110,388
  • 20
  • 126
  • 153