Skip to content

Instantly share code, notes, and snippets.

@ggirtsou
Created October 13, 2018 15:34
Show Gist options
  • Select an option

  • Save ggirtsou/708b9ef78ce69ab55e5c9df6614b28fb to your computer and use it in GitHub Desktop.

Select an option

Save ggirtsou/708b9ef78ce69ab55e5c9df6614b28fb to your computer and use it in GitHub Desktop.
A bash script I wrote to set up local directories as git repos
#/bin/bash
set -x
set -e
repos=(ai-labs cloud-backup cloud-cli cloud-compute cloud-configuration cloud-container-registry cloud-dashboard cloud-database cloud-dns cloud-identity cloud-key-management cloud-load-balancer cloud-memory-db cloud-networking cloud-nosql-db cloud-orchestrator cloud-persistent-volume cloud-protect cloud-pubsub cloud-rdbms-db cloud-search-engine cloud-storage cloud-time-series-db code-build monitoring-agent monitoring-aggregation monitoring-alerting monitoring-anomaly-detection monitoring-collection monitoring-processing monitoring-visualisation video-conference)
for repo in "${repos[@]}"
do
cd $repo && \
git init && \
git remote add origin git@git.byteslice.co.uk:/srv/git/$repo.git ; \
git add . ; \
git commit -m "Initial commit" ; \
git push -u origin master ; \
cd ../
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment