Can I concurrently pull my git repos without gnu parallel?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
On my home machine, I use the script gitpull.sh
to concurrently pull all the changes to the git repos under a given directory.
#!/usr/bin/bash
find $1 -name ".git" | sed -r 's|/[^/]+$||' | parallel git -C pull origin master
My problem is that parallel
is not installed on my work computer. Is it possible to alter my script without the use of parallel
?
gnu-parallel
add a comment |Â
up vote
1
down vote
favorite
On my home machine, I use the script gitpull.sh
to concurrently pull all the changes to the git repos under a given directory.
#!/usr/bin/bash
find $1 -name ".git" | sed -r 's|/[^/]+$||' | parallel git -C pull origin master
My problem is that parallel
is not installed on my work computer. Is it possible to alter my script without the use of parallel
?
gnu-parallel
do you have GNUfindutils
on your work computer? or something else that providesxargs
? if so, you can write a version of your gitpull.sh that pipes the sed output into a shell function that does something likexargs -I git pull -C origin master &
.
â cas
Jan 4 at 8:40
Is the reason why you do not have GNU Parallel covered by oletange.blogspot.com/2013/04/why-not-install-gnu-parallel.html? If not, please elaborate.
â Ole Tange
Jan 5 at 4:26
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
On my home machine, I use the script gitpull.sh
to concurrently pull all the changes to the git repos under a given directory.
#!/usr/bin/bash
find $1 -name ".git" | sed -r 's|/[^/]+$||' | parallel git -C pull origin master
My problem is that parallel
is not installed on my work computer. Is it possible to alter my script without the use of parallel
?
gnu-parallel
On my home machine, I use the script gitpull.sh
to concurrently pull all the changes to the git repos under a given directory.
#!/usr/bin/bash
find $1 -name ".git" | sed -r 's|/[^/]+$||' | parallel git -C pull origin master
My problem is that parallel
is not installed on my work computer. Is it possible to alter my script without the use of parallel
?
gnu-parallel
asked Jan 4 at 8:15
Brian Fitzpatrick
7291921
7291921
do you have GNUfindutils
on your work computer? or something else that providesxargs
? if so, you can write a version of your gitpull.sh that pipes the sed output into a shell function that does something likexargs -I git pull -C origin master &
.
â cas
Jan 4 at 8:40
Is the reason why you do not have GNU Parallel covered by oletange.blogspot.com/2013/04/why-not-install-gnu-parallel.html? If not, please elaborate.
â Ole Tange
Jan 5 at 4:26
add a comment |Â
do you have GNUfindutils
on your work computer? or something else that providesxargs
? if so, you can write a version of your gitpull.sh that pipes the sed output into a shell function that does something likexargs -I git pull -C origin master &
.
â cas
Jan 4 at 8:40
Is the reason why you do not have GNU Parallel covered by oletange.blogspot.com/2013/04/why-not-install-gnu-parallel.html? If not, please elaborate.
â Ole Tange
Jan 5 at 4:26
do you have GNU
findutils
on your work computer? or something else that provides xargs
? if so, you can write a version of your gitpull.sh that pipes the sed output into a shell function that does something like xargs -I git pull -C origin master &
.â cas
Jan 4 at 8:40
do you have GNU
findutils
on your work computer? or something else that provides xargs
? if so, you can write a version of your gitpull.sh that pipes the sed output into a shell function that does something like xargs -I git pull -C origin master &
.â cas
Jan 4 at 8:40
Is the reason why you do not have GNU Parallel covered by oletange.blogspot.com/2013/04/why-not-install-gnu-parallel.html? If not, please elaborate.
â Ole Tange
Jan 5 at 4:26
Is the reason why you do not have GNU Parallel covered by oletange.blogspot.com/2013/04/why-not-install-gnu-parallel.html? If not, please elaborate.
â Ole Tange
Jan 5 at 4:26
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
accepted
Instead of parallel you could use xargs with the -P flag. Something like:
find $1 -name ".git" | sed -r 's|/[^/]+$||' | xargs -I -n 1 -P 0 git -C pull origin master
add a comment |Â
up vote
2
down vote
You can use this tool Git-Plus to concurrently pull all the changes to the git repos under a given directory. Use this command
$ git multi pull
You can easily install it and use it .
add a comment |Â
up vote
1
down vote
You can do it using only bash, readlink, and find:
#!/bin/bash
while IFS= read -d '' -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git' -print0)
You can make it run a bit faster with careful use of find's -maxdepth
option. e.g. if you know that all .git
directories are going to be found only in the top-level sub-directories of the current directory, -maxdepth 3
will stop it recursing into any lower sub-directories.
I've used "$@"
with the find
command rather than the unquoted $1
you used so that not only is a directory argument optional, you can use multiple directory args and/or add whatever find options you might need to the command line.
If the version of find
on your work computer doesn't do -print0
, you can use n
as the input separator, but the script will break if any directory names contain a newline (which is uncommon but perfectly valid).
while IFS= read -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git')
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Instead of parallel you could use xargs with the -P flag. Something like:
find $1 -name ".git" | sed -r 's|/[^/]+$||' | xargs -I -n 1 -P 0 git -C pull origin master
add a comment |Â
up vote
2
down vote
accepted
Instead of parallel you could use xargs with the -P flag. Something like:
find $1 -name ".git" | sed -r 's|/[^/]+$||' | xargs -I -n 1 -P 0 git -C pull origin master
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Instead of parallel you could use xargs with the -P flag. Something like:
find $1 -name ".git" | sed -r 's|/[^/]+$||' | xargs -I -n 1 -P 0 git -C pull origin master
Instead of parallel you could use xargs with the -P flag. Something like:
find $1 -name ".git" | sed -r 's|/[^/]+$||' | xargs -I -n 1 -P 0 git -C pull origin master
answered Jan 4 at 8:48
sapensadler
48016
48016
add a comment |Â
add a comment |Â
up vote
2
down vote
You can use this tool Git-Plus to concurrently pull all the changes to the git repos under a given directory. Use this command
$ git multi pull
You can easily install it and use it .
add a comment |Â
up vote
2
down vote
You can use this tool Git-Plus to concurrently pull all the changes to the git repos under a given directory. Use this command
$ git multi pull
You can easily install it and use it .
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You can use this tool Git-Plus to concurrently pull all the changes to the git repos under a given directory. Use this command
$ git multi pull
You can easily install it and use it .
You can use this tool Git-Plus to concurrently pull all the changes to the git repos under a given directory. Use this command
$ git multi pull
You can easily install it and use it .
answered Jan 4 at 10:01
Jai Prak
1212
1212
add a comment |Â
add a comment |Â
up vote
1
down vote
You can do it using only bash, readlink, and find:
#!/bin/bash
while IFS= read -d '' -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git' -print0)
You can make it run a bit faster with careful use of find's -maxdepth
option. e.g. if you know that all .git
directories are going to be found only in the top-level sub-directories of the current directory, -maxdepth 3
will stop it recursing into any lower sub-directories.
I've used "$@"
with the find
command rather than the unquoted $1
you used so that not only is a directory argument optional, you can use multiple directory args and/or add whatever find options you might need to the command line.
If the version of find
on your work computer doesn't do -print0
, you can use n
as the input separator, but the script will break if any directory names contain a newline (which is uncommon but perfectly valid).
while IFS= read -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git')
add a comment |Â
up vote
1
down vote
You can do it using only bash, readlink, and find:
#!/bin/bash
while IFS= read -d '' -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git' -print0)
You can make it run a bit faster with careful use of find's -maxdepth
option. e.g. if you know that all .git
directories are going to be found only in the top-level sub-directories of the current directory, -maxdepth 3
will stop it recursing into any lower sub-directories.
I've used "$@"
with the find
command rather than the unquoted $1
you used so that not only is a directory argument optional, you can use multiple directory args and/or add whatever find options you might need to the command line.
If the version of find
on your work computer doesn't do -print0
, you can use n
as the input separator, but the script will break if any directory names contain a newline (which is uncommon but perfectly valid).
while IFS= read -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git')
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can do it using only bash, readlink, and find:
#!/bin/bash
while IFS= read -d '' -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git' -print0)
You can make it run a bit faster with careful use of find's -maxdepth
option. e.g. if you know that all .git
directories are going to be found only in the top-level sub-directories of the current directory, -maxdepth 3
will stop it recursing into any lower sub-directories.
I've used "$@"
with the find
command rather than the unquoted $1
you used so that not only is a directory argument optional, you can use multiple directory args and/or add whatever find options you might need to the command line.
If the version of find
on your work computer doesn't do -print0
, you can use n
as the input separator, but the script will break if any directory names contain a newline (which is uncommon but perfectly valid).
while IFS= read -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git')
You can do it using only bash, readlink, and find:
#!/bin/bash
while IFS= read -d '' -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git' -print0)
You can make it run a bit faster with careful use of find's -maxdepth
option. e.g. if you know that all .git
directories are going to be found only in the top-level sub-directories of the current directory, -maxdepth 3
will stop it recursing into any lower sub-directories.
I've used "$@"
with the find
command rather than the unquoted $1
you used so that not only is a directory argument optional, you can use multiple directory args and/or add whatever find options you might need to the command line.
If the version of find
on your work computer doesn't do -print0
, you can use n
as the input separator, but the script will break if any directory names contain a newline (which is uncommon but perfectly valid).
while IFS= read -r g ; do
dir="$(readlink -f "$g/..")"
git pull -C "$dir" origin master &
done < <(find "$@" -name '.git')
edited Jan 4 at 10:12
answered Jan 4 at 9:28
cas
37.7k44394
37.7k44394
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414719%2fcan-i-concurrently-pull-my-git-repos-without-gnu-parallel%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
do you have GNU
findutils
on your work computer? or something else that providesxargs
? if so, you can write a version of your gitpull.sh that pipes the sed output into a shell function that does something likexargs -I git pull -C origin master &
.â cas
Jan 4 at 8:40
Is the reason why you do not have GNU Parallel covered by oletange.blogspot.com/2013/04/why-not-install-gnu-parallel.html? If not, please elaborate.
â Ole Tange
Jan 5 at 4:26