Skip to content
Permalink
Browse files

Add script to switch between dev (ssh) and anonymous URLs.

  • Loading branch information...
brettviren committed Jul 31, 2015
1 parent 4cd65c0 commit 1e78f79ffe9588d0cd779116165b61664d12363f
Showing with 26 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +23 −0 switch-git-urls
@@ -17,3 +17,6 @@ doxy
*.fdb_latexmk
method.pdf
junk
*.bak
install
test_*.pdf
@@ -0,0 +1,23 @@
#!/bin/bash
who=${1:-anon}

usage () {
echo "./switch-git-urls dev|anon"
exit 1
}
if [ -z "$who" ] ; then usage ; fi

dev_url="git@github.com:BNLIF"
usr_url="https://github.com/BNLIF"

case $who in
dev) from_url=$usr_url; to_url=$dev_url;;
anon)from_url=$dev_url; to_url=$usr_url;;
*) usage ;;
esac

echo "Convert to $to_url"
sed -i -e 's|'$from_url'|'$to_url'|'g .gitmodules
git submodule sync
git remote set-url origin $to_url/wire-cell.git

0 comments on commit 1e78f79

Please sign in to comment.
You can’t perform that action at this time.