Created
          September 24, 2013 22:05 
        
      - 
      
- 
        Save spudfkc/6691969 to your computer and use it in GitHub Desktop. 
    Clones a repo and sets it up for Gerrit server. Only tested in bash. not super portable, but i find it useful I would recommend putting it in /usr/lib/git-core/ 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| if [ -z $1 ] | |
| then | |
| echo "Must supply a git project." | |
| echo "Usage git gclone <project-url>" | |
| return 1 | |
| fi | |
| ORIGIN=$1 | |
| REMOTE_NAME=<gerrit_remote_name> | |
| GERRIT_USER=<gerrit_username> | |
| GERRIT_REPO=<gerrit_repo_url> | |
| GERRIT_PORT=<gerrit_port> | |
| TMP=${ORIGIN/ssh*urbancode} | |
| GERRIT=ssh://$GERRIT_USER@$GERRIT_REPO:$GERRIT_PORT/$TMP | |
| GERRIT=${GERRIT/.git} | |
| git clone $ORIGIN | |
| cd $(basename ${ORIGIN/.git}) | |
| git remote add $REMOTE_NAME $GERRIT | |
| scp -p -P $GERRIT_PORT $GERRIT_USER@$GERRIT_REPO:hooks/commit-msg .git/hooks/ | |
| cd .. | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment