632d4f1c54cccad7eaeab337ec24de11295bc574 — abyxcos 2 years ago
A quick script to clone and pull from all your specified git repos.
1 files changed, 18 insertions(+), 0 deletions(-)

A backup_git.sh
A  => backup_git.sh +18 -0
@@ 1,18 @@
# Remove all commends from the repo list before updating. 
repos=`sed '/#/d' repos.txt`

for repo in $repos; do
	echo $repo
	# Clean up the repo name to match the folder
	repo_name=`echo $repo | sed 's,.*/,,' | sed 's,.git$,,'`

	if [ ! -d $repo_name ]; then
		# Clone the repo if it doesn't exist. 
		git clone $repo

	cd $repo_name
	git pull
	cd - >/dev/null