Table of Contents

This is a work-in-progress guide intended to help those that need to use Windows as their developer environment. It will address whatever issues developers commonly face, with hints/tools that have been tested and are in use by other OPNFV developers.

Setting up Git and Gerrit

Source: Bryan Sullivan, AT&T

There are multiple ways to get git/gerrit working on Windows. Here are two:

  1. Use Git for Windows
  2. Run a linux under VirtualBox, and use the guides for Linux (TO BE DESCRIBED)

Using Git for Windows

This procedure will be clarified as needed and will be re-tested to make sure nothing is missing, superfluous, or redundant. Any input is appreciated.

      #!/bin/bash
      PATH=$PATH:"/C/Program Files/Git/bin"
      eval `ssh-agent`
      # add my private key
      ssh-add (path to your private key, e.g. /c/files/my-key)
      # (optional) go to your git clone home dir
      cd (path to where you clone repos, e.g. /c/files/git) 
      source ~/.bashrc 
      Host (your git/gerrit host, e.g. opnfv.org)
        Hostname (your git/gerrit host, e.g. opnfv.org)
          User (your gerrit ID)
            IdentityFile (path to your private key, e.g. e.g. /c/files/my-key) 
      [filter "lfs"]
        clean = git-lfs clean %f
        smudge = git-lfs smudge %f
        required = true
      [user]
        name = (your gerrit ID)
        email = (your email)
      
    git config --global http.proxy (your proxy, e.g. http://proxy.example.com:8080)
    
      [http]
      #       proxy = http://proxy.example.com:8080
      
    git config --global --add gitreview.username "(your gerrit ID)"
    
    scp -p -P 29418 (your gerrit ID)@(your gerrit server domain, e.g. gerrit.example.com):hooks/commit-msg .git/hooks/
    
    curl -Lo .git/hooks/commit-msg gerrit.opnfv.org/gerrit/tools/hooks/commit-msg
    chmod +x .git/hooks/commit-msg
    pip install git-review
    
    git clone https://gerrit.opnfv.org/gerrit/copper && scp -p -P 29418 \
      blsaws@gerrit.opnfv.org:hooks/commit-msg copper/.git/hooks/
    
    git review -s
    

Creating a Commit and Gerrit Review

After making some changes in your repo clone:

    git add .
    
    git commit --signoff --all
    (add commit description in first line, e.g. "Add DMZ deployment policy use case.")
    (add reference to JIRA issue in 3rd line, e.g. "JIRA: COPPER-3")
    (you should see that the --signoff option has resulted in a line being added e.g. \
    Signed-off-by: (your gerrit ID) <(your email)>
    
    git review