~abyxcos/backup_scripts

632d4f1c54cccad7eaeab337ec24de11295bc574 — abyxcos 1 year, 4 months 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
	fi

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