<commit_before># GitGate Overview

## Flow Chart

![Flow Chart](http://gitgate.nullism.com/uploads/gitgate-flow-basic.png)

## Frequently Asked Questions

### What is GitGate? 

GitGate is a developer-friendly dual-repository code-review system for gatekeeping changes.

### How does GitGate work?

GitGate uses two repositories: *development* and *stable*. Developers commit to the *development* 
repository just like they normally would. Code from development is mirrored into *stable*
by checking out the commit in *development* and copying it to *stable*, and committing with `-C <commit sha1>` 
to duplicate the Author details. 

### What does repo access look like? 

    development/
        developer1 rw
        developer2 rw
        ...
        gitgate_user rw

    stable/
        gitgate_user rw
        build_user rw (ie: Jenkins)

# Getting Started

## Install GitGate

    $ sudo pip install gitgate

This will install GitGate and its requirements from PyPI. GitGate
requires Flask >= 0.9, and PeeWee > 2. 

## Setup Repositories

Assuming you have a current development repository called `swag` located
on GitHub:

    # Clone your existing repository
    $ git clone --bare https://github.com/yolo/swag.git tmp-swag.git
    $ cd tmp-swag.git
    # Create a new repository, called swag-stable
    $ git push --mirror https://github.com/yolo/swag-stable.git
    $ cd ../
    $ rm -rf tmp-swag.git
 
## Create a Site

    $ cd ~/mysites
    $ gitgate create-site
    Path [/home/yolo/mysites] /home/yolo/mysites/GitGate
    Database path [/home/yolo/mysites/GitGate/global.db]
    ...
    Site created!

## Create a Project

    $ cd ~/mysites/GitGate
    $ gitgate create-project
    Project name: swag
    Project path [/home/yolo/mysites/GitGate/projects/swag]
    Development clone url: https://github.com/yolo/swag.git
    Stable clone url: https://github.com/yolo/swag-stable.git
    ... 
    Project created!



<commit_msg>More installation documentation<commit_after># GitGate Overview

## Flow Chart

![Flow Chart](http://gitgate.nullism.com/uploads/gitgate-flow-basic.png)

## Frequently Asked Questions

### What is GitGate? 

GitGate is a developer-friendly dual-repository code-review system for gatekeeping changes.

### How does GitGate work?

GitGate uses two repositories: *development* and *stable*. Developers commit to the *development* 
repository just like they normally would. Code from development is mirrored into *stable*
by checking out the commit in *development* and copying it to *stable*, and committing with `-C <commit sha1>` 
to duplicate the Author details. 

### What does repo access look like? 

    development/
        developer1 rw
        developer2 rw
        ...
        gitgate_user rw

    stable/
        gitgate_user rw
        build_user rw (ie: Jenkins)

# Getting Started

## Initial Setup

### Install GitGate from PyPI

    $ sudo pip install gitgate

This will install GitGate and its requirements from PyPI. GitGate
requires Flask >= 0.9, and PeeWee > 2. 

### Setup Repositories

Assuming you have a current development repository called `swag` located
on GitHub:

    # Clone your existing repository
    $ git clone --bare https://github.com/yolo/swag.git tmp-swag.git
    $ cd tmp-swag.git
    # Create a new repository, called swag-stable
    $ git push --mirror https://github.com/yolo/swag-stable.git
    $ cd ../
    $ rm -rf tmp-swag.git
 
### Create a Site

    $ cd ~/mysites
    $ gitgate create-site
    Path [/home/yolo/mysites] /home/yolo/mysites/GitGate
    Database path [/home/yolo/mysites/GitGate/global.db]
    ...
    Site created!

### Create a Project

    $ cd ~/mysites/GitGate
    $ gitgate create-project
    Project name: swag
    Project path [/home/yolo/mysites/GitGate/projects/swag]
    Development clone url: https://github.com/yolo/swag.git
    Stable clone url: https://github.com/yolo/swag-stable.git
    ... 
    Project created!

### Start the Daemon

    $ cd ~/mysites/GitGate
    $ ./daemon.py &

### Clone the Development Repository

This is the repository your developers work against.

    $ cd ~/github
    $ git clone https://github.com/yolo/swag.git

## Committing

### Making Changes

Using the example from Initial Setup.

    $ cd ~/github/swag
    $ echo "Here's a new file" > newfile.txt
    $ git commit newfile.txt -m "Added a new file"
    $ git push origin master

### Approve the change in GitGate

Navigate to `yourhost:5000` and login using the admin credentials
created in the Project Creation step.


{'fraction_non_alphanumeric': 0.09710880600308983, 'fraction_numerical': 0.0035312293092032666, 'mean_word_length': 2.9442993907745865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2701926', 'n_tokens_mistral': 1446, 'n_tokens_neox': 1355, 'n_words': 470}