DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far...

Welcome! This is a Q&A website for computer programmers and users alike, focused on helping fellow programmers and users. Read more

What are you stuck on? Ask a question and hopefully somebody will be able to help you out!
+2 votes

I need to clone (and later, pull) many repositories all with several set of options. For a lack of a better way, what I'm doing is

git clone <option> <option> <option> <option> ... repository_1 && \
git clone <option> <option> <option> <option> ... repository_2 && \
...

Is there a way to do this in a single command without repeating all the options?

git clone <option> <option> <option> <option> ... repository_1 repository_2 ...
by

1 Answer

+2 votes
 
Best answer

echo repository_1 repository_2 ... | tr " " "\n" | xargs -L1 git clone

You can add your options to the git clone at the end

by
selected by
+1

I've just noticed in the manpage that the -l is deprecated in favor of -L <max-lines>. So it should be -L 1 instead of -l.

0

Thanks, edited accordingly :)

0

Worked like a charm

Contributions licensed under CC0
...