Advertisement
overloop

gitolite.sh

Oct 29th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. host="example.com"
  4. gitolite="/home/user/gitolite-admin";
  5.  
  6. current=$(pwd)
  7.  
  8. if [ $# -eq 2 ]; then
  9. repo=$1;
  10. repo_path=$2;
  11. else
  12. echo "usage: $0 repo repo_path";
  13. exit -1
  14. fi
  15.  
  16. cd $gitolite
  17. vim conf/gitolite.conf && git add . && git commit -am "$repo" && git push
  18.  
  19. cd $current
  20. cd $repo_path
  21. git init && vim .gitignore && git add . && git status
  22. echo -n "continue? (y/n): "
  23. read ans
  24. if [ "$ans" == "y" ]; then
  25. git commit -am "initial" && git remote add origin git@$host:$repo && git push origin master
  26. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement