This is a draft !!!

Bcfg2 Git HOWTO

This is a draft document in progress, and is not official policy of the Bcfg2 project.

Git Resources

Repositories

Configuration

After installing git, identify yourself to git with your name and your email address.

$ git config --global user.name "Your name"
$ git config --global user.email "your.name@example.com"

If you want to use a different email address for the Bcfg2 repository set it after the checkout in the repository directory with:

$ git config user.name "Your name"
$ git config user.email "your.name@example.com"

Those entries are store in /path/to/repository/.git/config and can edited anytime. git can show you the content of the config file.

$ git config -l

Checkout

You can checkout the source code with the following command:

The main repository:

$ git clone git://git.mcs.anl.gov/bcfg2.git

The github mirror:

$ git clone https://github.com/Bcfg2/bcfg2.git

Patches

We assume that you have checked out the source and are in the repository directory. First step is to create a new branch.

$ git checkout -b new_plugin

Make changes, add new features, write a plugin, or fix typos. Commit every change to your new branch.

$ git add new_plugin.py
$ git commit -m "Plugin xyz added"

Note that no changes are in the master branch at the moment. But git log knows everything about your local commit.

$ git log --pretty=oneline -3

If you are happy with the result, make the patch.

git format-patch master --stdout > new_plugin.patch

Be aware that your patches need to be BSD licensed for mainline inclusion.

Please send your patches to the Bcfg mailing list or open a ticket in the ticketing system.

Fork / Pull request

 github provides tools for collaboration including a way to easy fork existing repositories. Go to the  Bcfg2 github mirror and fork this repository. For more detail please refer to  Forking a project. Clone the fork:

$ git clone git@github.com:your_github_username/bcfg2.git

At the moment there is no connection to the upstream repository. You need to add another remote named "upstream" which points to the upstream repository.

$ cd bcfg2
$ git remote add upstream git://github.com/Bcfg2/bcfg2.git

Make changes, add new features, write a plugin, or fix typos. Then commit all changes.

$ git add new_file
$ git commit new_file -m "This is a new file"
$ git push origin master

If you are done, send a  pull request.

Don't forget to pull-in changes from the upstream repository from time to time as described in the  Forking a project document.

$ git fetch upstream
$ git merge upstream/master

Commit

Please visit the Git access page or mail the Bcfg mailing list for details about the application for direct git repository access.

$ git add edited_file
$ git commit -m "A little comment about the change"
$ git push origin master