ITK/Git: Difference between revisions

From KitwarePublic
< ITK
Jump to navigationJump to search
m (typo)
(Add the historical label after Change Id I5b79451da962c95614c65e09679bc8b5c12b6dea was merged)
 
(58 intermediate revisions by 11 users not shown)
Line 1: Line 1:
__TOC__
{{ Historical }}
 
==Introduction==


ITK version tracking and development is hosted by [http://git-scm.com Git].
ITK version tracking and development is hosted by [http://git-scm.com Git].
Please select a task for further instructions:


=Official Repository=
{|border="0"
 
|-
One may browse the repository online using the [http://git.wiki.kernel.org/index.php/Gitweb Gitweb] interface at http://itk.org/gitweb.
|width=70%|
 
Main Tasks:
==Cloning==
|-
 
|
One may clone the repository using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone] through the native <code>git</code> protocol:
:*<span style="font-size: 1.5em">[[Git/Download|Install Git]]</span> - Git 1.6.6 or greater is preferred (required for development)
 
|-
$ git clone git://itk.org/ITK.git
|
 
:*<span style="font-size: 1.5em">[[ITK/Git/Download|Download ITK]] - Users start here</span>
or through the (less efficient) <code>http</code> protocol:
|-
 
|
<pre>
:*<span style="font-size: 1.5em">[[ITK/Git/Develop|Develop ITK]] - Contributors start here</span>
$ git clone http://itk.org/ITK.git
|-
</pre>
|
 
Other Tasks:
All further commands work inside the local copy of the repository created by the clone:
|-
 
|
$ cd ITK
:*<span style="font-size: 1.5em">[[ITK/Git/Dashboard|Test ITK]]</span> - CDash client setup
|-
|
:*<span style="font-size: 1.5em">[[Git/Resources|Learn Git]]</span> - Third-party documentation
|}


If you want to run the tests you also need to clone the <code>Testing/Data</code> submodule:
''The remainder of this page provides reference information and links.  It is not intended to provide instructions.''


$ git submodule update --init
==Repositories==


For ITKApps the URLs are
One may browse the repositories online using the [https://git.wiki.kernel.org/index.php/Gitweb Gitweb] interface at http://itk.org/gitweb.


<pre>
{|border="1" cellspacing="0" cellpadding="3"
git://itk.org/ITKApps.git
!Repository
http://itk.org/ITKApps.git
!Purpose
</pre>
!Access
!URL
|-
|rowspan=3|<code>ITK.git</code>
|rowspan=3|Insight Toolkit
|clone (git)
|<code>git://itk.org/ITK.git</code>
|-
|clone (http)
|<code>http://itk.org/ITK.git</code>
|-
|push (ssh)
|<code>git@itk.org:ITK.git</code>
|-
|rowspan=3|<code>stage/ITK.git</code>
|rowspan=3|ITK Topic Stage
|clone (git)
|<code>git://itk.org/stage/ITK.git</code>
|-
|clone (http)
|<code>http://itk.org/stage/ITK.git</code>
|-
|push (ssh)
|<code>git@itk.org:stage/ITK.git</code>
|-
|rowspan=3|<code>ITKApps.git</code>
|rowspan=3|Insight Applications
|clone (git)
|<code>git://itk.org/ITKApps.git</code>
|-
|clone (http)
|<code>http://itk.org/ITKApps.git</code>
|-
|push (ssh)
|<code>git@itk.org:ITKApps.git</code>
|-
|rowspan=3|<code>ITKData.git</code>
|rowspan=3|ITK <code>Testing/Data</code> Submodule
|clone (git)
|<code>git://itk.org/ITKData.git</code>
|-
|clone (http)
|<code>http://itk.org/ITKData.git</code>
|-
|push (ssh)
|<code>git@itk.org:ITKData.git</code>
|}


==Branches==
==Branches==


At the time of this writing the repository has the following branches:
At the time of this writing the <code>ITK.git</code> repository has the following branches:


* '''master''': Development (default)
* '''master''': Development (default)
* '''release''': Maintenance of latest release
* '''release-3.20''': Maintenance of the ITKv3 series
* '''nightly-master''': Follows '''master''', updated at 01:00 UTC
* '''nightly-master''': Follows '''master''', updated at 01:00 UTC
* '''hooks''': Local commit hooks ([[Git/Hooks#Local|place]] in .git/hooks)
* '''hooks''': Local commit hooks ([[Git/Hooks#Local|place]] in .git/hooks)
* '''dashboard''': Dashboard script (see [[#Dashboard|below]])
* '''dashboard''': Dashboard script ([[ITK/Git/Dashboard|setup]] a CDash client)


Release branches converted from CVS have been artificially merged into master.
Release branches converted from CVS have been artificially merged into master.
Actual releases have tags named by the release version number.
Actual releases have tags named by the release version number.
=Development=
We provide here a brief introduction to '''ITK''' development with Git.
See the [[Git/Resources|Resources]] page for further information such as Git tutorials.
==Introduction==
We require all commits in ITK to record valid author/committer name and email information.
Use [http://www.kernel.org/pub/software/scm/git/docs/git-config.html git config] to introduce yourself to Git:
$ git config --global user.name "Your Name"
$ git config --global user.email "you@yourdomain.com"
Note that "Your Name" is your ''real name'' (e.g. "John Doe", not "jdoe").
While you're at it, optionally enable color output from Git commands:
$ git config --global color.ui auto
If less displays strange characters and no color, your LESS environment variable may already be set. You can override the less options with:
$ git config --global core.pager "less -FXRS"
The <code>--global</code> option stores the configuration settings in <code>~/.gitconfig</code> in your home directory so that they apply to all repositories.
==Hooks==
The '''hooks''' branch provides local commit hooks to be placed in <code>.git/hooks</code>.
It is shared by many <code>public.kitware.com</code> repositories.
See the general [[Git/Hooks|hooks]] information page to set up your local hooks.
==Workflow==
We've chosen to approximate our previous CVS-based development workflow after the initial move to Git, at least while things get settled.
The basic rule is to rebase your work on origin/master before pushing:
git fetch origin
git rebase origin/master
or
git pull --rebase
The server will refuse your push if it contains any merges.
Later we will move to a full [[Git/Workflow/Topic|branchy workflow]] based on topic branches.
=Publishing=
==Pushing==
Authorized developers may publish work directly to <code>itk.org/ITK.git</code> using Git's SSH protocol.
To request access, fill out the [https://www.kitware.com/Admin/SendPassword.cgi Kitware Password] form.
See the [[Git/Publish#Push_Access|push instructions]] for details.
For ITK, configure the push URL:
git config remote.origin.pushurl git@itk.org:ITK.git
For ITKApps, configure the push URL:
git config remote.origin.pushurl git@itk.org:ITKApps.git
===Update Hook===
The itk.org repository has an <code>update</code> hook.
When someone tries to push changes to the repository it checks the commits as documented [[Git/Hooks#update|here]].
=Testing=
==Dashboard==
The [[#Branches| dashboard]] branch contains a dashboard client helper script.
Use these commands to track it:
$ mkdir -p ~/Dashboards/ITKScripts
$ cd ~/Dashboards/ITKScripts
$ git init
$ git remote add -t dashboard origin git://itk.org/ITK.git
$ git pull origin
The <code>itk_common.cmake</code> script contains setup instructions in its top comments.
Update the '''dashboard''' branch to get the latest version of this script by simply running
$ git pull origin
=Troubleshooting=
==Firewall Blocks Port 9418==
Some institutions have firewalls that block Git's native protocol port 9418.
Use the "<code>url.<base>.insteadOf</code>" configuration option to map git URLs to http:
<pre>
$ git config --global url.http://itk.org/.insteadOf git://itk.org/
</pre>
This tells Git to translate URLs under the hood by replacing prefixes.
After running these commands ''once'' in your home directory then you can just use the "<code>git://</code>" mentioned elsewhere on this page and git will use the http protocol automagically.
=Resources=
Additional information about Git may be obtained at sites listed [[Git/Resources|here]].

Latest revision as of 14:51, 6 October 2017

Introduction

ITK version tracking and development is hosted by Git. Please select a task for further instructions:

Main Tasks:

  • Install Git - Git 1.6.6 or greater is preferred (required for development)

Other Tasks:

The remainder of this page provides reference information and links. It is not intended to provide instructions.

Repositories

One may browse the repositories online using the Gitweb interface at http://itk.org/gitweb.

Repository Purpose Access URL
ITK.git Insight Toolkit clone (git) git://itk.org/ITK.git
clone (http) http://itk.org/ITK.git
push (ssh) git@itk.org:ITK.git
stage/ITK.git ITK Topic Stage clone (git) git://itk.org/stage/ITK.git
clone (http) http://itk.org/stage/ITK.git
push (ssh) git@itk.org:stage/ITK.git
ITKApps.git Insight Applications clone (git) git://itk.org/ITKApps.git
clone (http) http://itk.org/ITKApps.git
push (ssh) git@itk.org:ITKApps.git
ITKData.git ITK Testing/Data Submodule clone (git) git://itk.org/ITKData.git
clone (http) http://itk.org/ITKData.git
push (ssh) git@itk.org:ITKData.git

Branches

At the time of this writing the ITK.git repository has the following branches:

  • master: Development (default)
  • release: Maintenance of latest release
  • release-3.20: Maintenance of the ITKv3 series
  • nightly-master: Follows master, updated at 01:00 UTC
  • hooks: Local commit hooks (place in .git/hooks)
  • dashboard: Dashboard script (setup a CDash client)

Release branches converted from CVS have been artificially merged into master. Actual releases have tags named by the release version number.