Introduction

Install git:

Debian/Ubuntu/derivatives:

 apt-get install git-core 
 apt-get install gitk # Graphical browser
 apt-get install git-svn

RedHat/Fedora:

 yum install git gitk git-svn

OpenSUSE:

 zypper install git gitk git-svn

Windows

Mac OS X

Tutorials:

More resources:

Cheat sheets:

Using git for developing a plugin

Start with the basic skeletion. E.g. generated with QGIS plugin Creator.

 unzip Zoomer.zip && cd Zoomer

Create a Git repository:

 git init

Add all files to the repository:

 git add .

Commit the initial version:

 git commit -a

Using a git mirror of QGIS

Clone the repository from github:

 git clone git://github.com/qgis/Quantum-GIS.git qgis
 cd qgis

View a list of all included branches:

 git branch -a

Create & Checkout a local branch from a remote branch:

 git checkout -b threading-globe origin/threading-globe

To checkout the master branch and update from the main QGIS project:

 git checkout master
 git pull --rebase

Start your own branch for any work you will do:

 git checkout -b myworkbranch

Add your QGIS fixes or extension and commit:

 git commit -a -m "First commit" 

Merge the latest commits from master into your local branch:

 git fetch origin
 git merge origin/master

Resolve conflicts:

 git mergetool
 git commit -a

Create a patch against master:

 git diff master > mywork.patch

Send it the mailing list or a core developer for review.

Or send a pull request to an source control committer using git with your public git repository URL.

Git-transport.png (43 KB) Redmine Admin, 2011-11-23 04:44 PM