04 December 2011

This post is a quick example on how to submit an opennebula patch with Git. You can find a more complete example here on Gnome.

Setting up your Git environment

Let Git know you you are.

git config --global user.name "Patrice LACHANCE"
git config --global user.email patlachance <at> gmail <dot> com
echo export LESS=-R >> ~/.bashrc

If you don’t specify the ‘–global’ parameter, this will apply only to this single checked-out directory. Save the export command in your shell environment’s configuration file.

Getting the source code

Look OpenNebula development page for more information.

mkdir /srv/compile
git clone git://git.opennebula.org/one.git
cd one
git checkout -b one-3.0 origin/one-3.0

This will checkout the master branch. If you want a specific branch you can extract one.

git checkout -b one-3.0 origin/one-3.0

Edit some files. Be creative and customize the tool to suit your need!

Looking at the changes you made

Run ‘git diff’ to see which files where modified or added to the tree. You can focus on specific files.

git diff [files]

Commiting your change in your local repository

Commiting the files will create a new checkpoint in the Git repository.

git commit [files]

Generate the patch file

git format-patch HEAD^

An editor will fire up. Enter a quick description of your changes, save and quit (:wq). Now send the resulting file to the maintainer of the code to share with the commmunity!



blog comments powered by Disqus