Infrastructure/Git: Difference between revisions

From KDE Community Wiki
m (Remove leftover translation markers)
(102 intermediate revisions by 25 users not shown)
Line 1: Line 1:
[[Category:Needs Attention]]
This is the hub page for all information about the use of Git by KDE.
This is the hub page for all information about the use of Git by KDE.


This page is a work in progress where all new Git material is being organised. Most of these sections will eventually be moved to their own pages. Feel free to add stuff.
This section provides details on using the KDE Git infrastructure.  This is intended for use by KDE developers to find out how KDE uses Git and how to set up Git for use with KDE.
 
== Git at KDE ==
KDE currently offers code hosting using Git. Additionally, KDE also maintains a limited Subversion infrastructure for certain special projects, such as translations and older websites.
 
=== Anonymous access ===
 
Both Git and Subversion repositories can be accessed anonymously by anyone. This access takes place from <code>anongit.kde.org</code> and <code>anonsvn.kde.org</code> for Git and Subversion respectively, and grants read-only access to the same repositories which are available to contributors with developer accounts.
 
For Git, it is possible to perform clones and fetches over the HTTPS protocol only. The insecure <code>git://</code> protocol is not supported.
 
KDE also maintains a mirror of its mainline Git repositories on [https://github.com/kde/ GitHub]. This mirror is read-only, and disables all of GitHub's additional features, such as issues, the wiki, and downloads, in favour of KDE's own hosted services. Additionally, pull requests on these repositories are not accepted, but code changes can always be accepted through KDE's code-review services. And still, GitHub may be used / searched more intuitively than alternatives, e.g. when a particular [https://github.com/KDE/extra-cmake-modules/releases ECM] version is needed, as it will.  


=External Git Resources=
For Subversion, access is only provided over the Subversion protocol. If you are behind a restrictive firewall and need to access the KDE Subversion repository anonymously (and have no other means of network access), please file a [https://go.kde.org/u/systickets ticket].
Links to useful external sites about Git
 
=== Pushing ===
 
Push or commit access to all KDE code repositories is open to any holder of a KDE developer account, subject to few limitations. This model allows contributors to easily make contributions to all parts of KDE without needing further approval. All commits made to either Git or Subversion are subject to commit hooks which will perform a few quality control checks and can take other actions on behalf of the developer. In the case of both Git and Subversion it is only possible to commit over SSH.


==Official Documentation==
With KDE Git, it is recommended to use a shortcut to access repositories instead of directly cloning them from the Git server itself. This shortcut allows you to use a local mirror of the repositories, and should improve response times. To setup a <code>kde:</code> shortcut, you should add the following configuration block to <code>~/.config/git/config</code>. If your network blocks the Git protocol, then you can exchange that for HTTP instead.
* http://git-scm.com/documentation


==Git for SVN Users==
<pre>[url &quot;https://anongit.kde.org/&quot;]
* http://git-scm.com/course/svn.html
    insteadOf = kde:
[url &quot;git@git.kde.org:&quot;]
    pushInsteadOf = kde:</pre>
Once setup as above, you can clone and push to repositories through the URL <code>kde:group/repository</code>.


==Tutorials==
As Subversion requires that checkouts you are committing from are made from the same location you are committing to, checkouts should be made from the Subversion server directly. It can be accessed at <code>svn+ssh://[email protected]/home/kde/</code>. If you have existing checkouts, you will need to relocate them using the <code>svn switch</code> command before you are able to commit.


==Cheat Sheets==
=== Browsing ===
* http://cheat.errtheblog.com/s/git


=Git Policies=
To allow for quick review of code, web repository browsers exist for both Git and Subversion repositories. Those interested in browsing Subversion should visit [https://websvn.kde.org/ WebSVN], which will contain the latest commits made to the KDE Subversion repository subject to a delay of 10 minutes at maximum.
KDE policies on Git.  More generic development policies go elsewhere.


=Git Configuration=
In the case of Git, repository browsing is available via [https://invent.kde.org/ GitLab]. Additionally, all mainline repositories are available on [https://github.com/kde GitHub] and can be browsed there. Please note that personal repositories are only browsable on our GitLab, they are not mirrored to GitHub.


How to set up Git for use in KDE.
If you need to link to materials which are stored in either Git or Subversion repositories on KDE infrastructure, it is requested that you do not embed the content directly, but simply link to it. Embedding content, such as images, causes significantly higher load on the repository browser servers, making it unavailable for others wishing to use it. This is particularly relevant for blog posts on Planet or any other high traffic web page.


=== Configuration Levels ===
=== New repositories ===


Your Git configuration operates at 3 levels:
To allow for free form development in a manner similar to Subversion did, KDE Git allows personal repositories to be created on demand as needed. You can [https://invent.kde.org/projects/new create personal repositories] from the GitLab web interface. You can also "fork" an existing official KDE repository.
* System
* User
* Repository


The System Level sets up global Git configuration defaults for every User and Repository on your system.  We will ignore these for our purposes as they are usually blank.
Personal repositories and forks can be deleted at any time.


The User Level sets up the default configuration for a particular User to apply to all repositories used by that User. Settings made at this level will always override any matching System Level settings. The User Configuration is stored in your ~/.gitconfig file.
From time to time it may be necessary to create new project repositories, to contain newly developed applications, migrate existing applications from Subversion or to bring new projects under the KDE umbrella. New repositories can be requested by filing a [https://go.kde.org/u/systickets ticket], and will be created in the appropriate group on invent.kde.org.


The Repository Level sets up the configuration for a particular Repository clone.  Settings made at this level will always override any matching User or System Level settings.  The Repository Configuration is stored in the repository .git/config file.
=== Extra Karma ===


=== URL Renaming ===
At times contributors may find it necessary to push or commit to certain repositories or paths which are protected. In this case the server will reject your request with a message such as '''insufficient karma''' or '''access denied'''. This protection is most often applied to repositories which run parts of the infrastructure such as websites or other crucial components.


Instead of having to remember and type in the different full git addresses for pulling and pushing, we recommend you add the following to your Git User Configuration (~/.gitconfig):
If you would like to request access to these protected areas, please file a [https://go.kde.org/u/systickets ticket], mentioning which repositories or paths you are trying to change.


[url "git://anongit.kde.org/"]
A complete manual on how to use KDE's Git services, along with some best practices, is available on the [http://community.kde.org/Sysadmin/GitKdeOrgManual KDE Community Wiki].
    insteadOf = kde:
[url "git@git.kde.org:"]
    pushInsteadOf = kde:


=== RSA Key fingerprint for git.kde.org===
=== Hooks ===
c8:45:ba:89:85:11:78:b5:a4:09:d9:31:f6:7f:7c:79
Kde provides some [[/Hooks |git hooks]] to perform and automatize some actions on push.


=Git Recipes=
=== Server Fingerprints ===
Brief recipes for common use cases.
The SSH host server key fingerprints are as follows for both Git and Subversion access:


=== Working with stable branches ===
* '''RSA-2048 (MD5)''': <code>f9:54:62:b2:90:f2:dc:08:df:f4:a3:fa:c5:2a:a0:c8</code>
* '''RSA-2048 (SHA256)''': <code>eONstlOUy0LjhlkjK90e1/bm95fOqnz8qcUsijWuP0Q</code>
* '''ECDSA-256 (MD5)''': <code>23:62:3e:0b:18:f2:5d:e9:66:8a:80:fb:82:53:84:b5</code>
* '''ECDSA-256 (SHA256)''': <code>Bvp9zqBBiEf9QdpX09B0PL2CkDa1B64WtkKZyTq7XhM</code>
* '''ED25519-256 (MD5)''': <code>f3:17:e5:0b:79:16:2b:73:45:fa:5d:23:24:eb:33:40</code>
* '''ED25519-256 (SHA256)''': <code>x8pnmJ/gZmuw68V+wJUlT3MreIzPACzKmd/Ybei9gBA</code>


For kdelibs, kdepimlibs and kde-workspace, the remote stable branches are named as follows:
== Resources ==


origin/KDE/4.6
Links to useful external sites about Git


For these modules, to set up a local stable branch to track the remote stable branch:
=== Official Documentation ===


git branch --track KDE/4.6 origin/KDE/4.6
* [http://git-scm.com/documentation Links to git official documentation]
git checkout KDE/4.6


To then push changes to the remote stable branch:
=== Git for SVN Users ===


git push origin KDE/4.6:KDE/4.6
* [http://git-scm.com/course/svn.html The git-svn Crash Course]


In other projects the remote stable branches are named as follows:
=== Git books ===


origin/4.6
* [http://progit.org/book/ Pro Git] - An easy to understand book on git (CC licensed).


For these modules, to set up a local stable branch to track the remote stable branch:
* [http://book.git-scm.com/ The git community book], also as a [http://book.git-scm.com/book.pdf pdf]


git branch --track 4.6 origin/4.6
=== Tutorials ===
git checkout KDE/4.6


To then push changes to the remote stable branch:
* [http://www-cs-students.stanford.edu/~blynn/gitmagic/ Git Magic] - A good intro to git (in several languages!)


git push origin 4.6:4.6
*[http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable]
- Essential reading if you want to truly understand git.


=== Cherry Picking ===
* [http://www.gitcasts.com/ Git Screencasts]


When cherry picking between stable and unstable branches, use the following form:
* [http://try.github.io/ tryGit] A 15 minute online interactive tutorial


git cherry-pick -e -x <original-commit>
=== KDE's Git Infrastructure ===


The -e will allow you to edit the commit message to add any extra details and to change the BUG/CCBUG/FIXED-IN messages.
The [http://community.kde.org/Sysadmin/GitKdeOrgManual KDE Git System Administrators Manual] is a useful resource for more details on the technical implementation of the KDE Git infrastructure.


The -x will automatically add the original commit number to the end of the commit message to enable better tracing and to simplify merging.  Only do this if the original commit was already published in a public repository, i.e. your are forward porting or back porting the patch.
For more information on how the KDE Git Repositories are organized, please see the [[Guidelines_and_HOWTOs/Build_from_source|Build from source]] page.


=Git Tutorials=
Other:
More in-depth instructions in using Git
* The new [[Policies/Commit Policy|Commit Policy]] is being reviewed, applied to both SVN and Git.
* [[/GitHub Mirror/]] has been created and policy is in development (Sep 2015).


=== KDE Git Recipes ===


= Documentation Changes =
Short recipes for using Git with the KDE infrastructure.


== Existing Pages For Review ==
Please see the [[Special:myLanguage/Infrastructure/Git/Recipes|Git Recipes page]].
Existing KDE pages about Git, SVN, and/or building KDE that need to be revised.  When revising pages try to split the generic development and revision control policies separate from Git specific stuff.  Do not refer to "the KDE Git Repository" but instead the "KDE Code Repository".  Lots of small simple pages that are less daunting to newbies and can be linked to from multiple locations are preferred to massive walls of text.


On community.kde.org:
=== KDE Git Tutorials ===
* http://community.kde.org/Sysadmin/GitKdeOrgManual
* http://community.kde.org/20110213_GitWorkflowAgenda
* http://community.kde.org/20110213_GitWorkflowAgenda/StevesIdea


On techbase.kde.org:
More in-depth instructions in using Git.
* [[Getting Started]]
* [[Getting Started/Build/KDE4]]
* [[Getting Started/Build/KDE4.x]]
* [[Getting Started/Build/KDE4/Prerequisites]]
* [[Getting Started/Build/KDE4/Windows/subversion]]
* [[Getting_Started/Increased_Productivity_in_KDE4_with_Scripts]]
* [[Getting_Started/Build/kdesrc-build]]
* [[Getting Started/Sources/Anonymous SVN]]
* [[Getting_Started/Sources/Using_Subversion_with_KDE]]
* [[Getting Started/Sources/Amarok Git Tutorial]]
* [[Getting_Started/Set_up_KDE_4_for_development]]
* [[Getting_Started/Using_an_IDE_with_KDE4]]
* [[Policies/SVN_Commit_Policy]]
* [[Policies/SVN_Guidelines]]
* [[Infrastructure/Tools]]
* [[Infrastructure/Tutorials/Git]]
* [[Infrastructure/Tutorials/Git/BestPractices]]
* [[Infrastructure/Tutorials/Git/Intermediate]]
* [[Infrastructure/Tutorials/Git/Recipes]]
* [[Infrastructure/Tutorials/Git/Create a patch]]
* [[Infrastructure/Tutorials/Git/git-svn]]
* [[Infrastructure/Tutorials/Git/Basics]]
* [[Infrastructure/Tutorials/Git/KdeOnGit]]
* [[Infrastructure/Tutorials/Git/kde-qt]]
* [[Infrastructure/Tutorials/Git/Pushing]]
* [[Infrastructure/Tutorials/Git/decoding-git]]
* [[Projects/rekonq/Git_with_rekonq_HowTo]]
* [[Projects/Related/Subversion]]
* [[Contribute/Get a SVN Account]]
* [[Contribute/First Steps with your KDE SVN Account]]


There are also numerous other pages referring to "the KDE SVN/subversion repositories" which should be replaced with the generic "KDE code repositories".
* [[Special:myLanguage/Infrastructure/Tutorials/Git/GitQuickStart|A quick step-by-step guide for getting started]]


There are also numerous translated pages which will need to be updated once the original pages are completed.
* [[Special:myLanguage/Infrastructure/Tutorials/Git/Create a patch|Creating a patch]]


== New Page Structure ==
Please help filling this section by
* checking the links at the bottom of the page and see which still have valid content
* write tutorials yourself


* [[Getting_Started]]
=== Cheat Sheets ===
* [[Getting_Started/Build]]
* [[Getting_Started/Build/Environment]]
* [[Getting_Started/Build/Requirements]]
* [[Getting_Started/Build/Qt]]
* [[Getting_Started/Build/KdeSupport]]
* [[Getting_Started/Build/Windows]]
* [[Getting_Started/Build/Mac_OS_X]]
* [[Getting_Started/Run]]
* [[Getting_Started/Run/Shell]]
* [[Getting_Started/Run/Nested_Session]]
* [[Getting_Started/Run/Full_Session]]


== For Deletion ==
* [http://cheat.errtheblog.com/s/git Quick reference]


The following pages can now be deleted:
* [http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html Illustrated git cheat sheet]  
* [[Getting_Started/Build/KDE4/Generic]]
(broken image, get it from [[Media:Zrusin-git-cheat-sheet-medium.png]])
* [[Build_requirements]]
</translate>
* [[Build/Stories]] and child pages - Belong somewhere else, either distro wiki or community.k.o
* [[Build/KDE4/Errors]]
* [[Getting_Started/Build/FAQ]]
* [[Getting_Started/Build/Coexisting_Versions]]
* [[Development_user]]
* [[Getting_Started/Build/KDE4_Alpha_1]]
* [[Getting_Started/Build/KDE4_Alpha_2]]
* [[Getting_Started/Build/compilationfaq.html]]
* [[Getting_Started/working_kdesrcbuildrc]]
* [[Getting_Started/working_kdesrcbuildrc/4.6]]
* [[Getting_Started/working_kdesrcbuildrc/4.6/Kubuntu_10.04_qt-copy]]
* [[Getting_Started/working_kdesrcbuildrc/4.6/]]
* [[Getting_Started/working_kdesrcbuildrc/4.6//Kubuntu_10.04_qt-copy]]
* [[Getting_Started/Build/KDE4/Mac_OS_X_10.5_issues]]
* [[Getting_Started/Build/KDE4/Cygwin]]
* [[Getting_Started/Distributions/openSUSE_Unstable]]
* http://techbase.kde.org/Growth_hormone_human_prescription_-_buy_hgh_191_-_hgh_injections_in_coppell_texas
* http://techbase.kde.org/History_of_soma_drug_-_shipping_soma_to_louisiana_-_buy_soma_com

Revision as of 19:53, 28 April 2021


This is the hub page for all information about the use of Git by KDE.

This section provides details on using the KDE Git infrastructure. This is intended for use by KDE developers to find out how KDE uses Git and how to set up Git for use with KDE.

Git at KDE

KDE currently offers code hosting using Git. Additionally, KDE also maintains a limited Subversion infrastructure for certain special projects, such as translations and older websites.

Anonymous access

Both Git and Subversion repositories can be accessed anonymously by anyone. This access takes place from anongit.kde.org and anonsvn.kde.org for Git and Subversion respectively, and grants read-only access to the same repositories which are available to contributors with developer accounts.

For Git, it is possible to perform clones and fetches over the HTTPS protocol only. The insecure git:// protocol is not supported.

KDE also maintains a mirror of its mainline Git repositories on GitHub. This mirror is read-only, and disables all of GitHub's additional features, such as issues, the wiki, and downloads, in favour of KDE's own hosted services. Additionally, pull requests on these repositories are not accepted, but code changes can always be accepted through KDE's code-review services. And still, GitHub may be used / searched more intuitively than alternatives, e.g. when a particular ECM version is needed, as it will.

For Subversion, access is only provided over the Subversion protocol. If you are behind a restrictive firewall and need to access the KDE Subversion repository anonymously (and have no other means of network access), please file a ticket.

Pushing

Push or commit access to all KDE code repositories is open to any holder of a KDE developer account, subject to few limitations. This model allows contributors to easily make contributions to all parts of KDE without needing further approval. All commits made to either Git or Subversion are subject to commit hooks which will perform a few quality control checks and can take other actions on behalf of the developer. In the case of both Git and Subversion it is only possible to commit over SSH.

With KDE Git, it is recommended to use a shortcut to access repositories instead of directly cloning them from the Git server itself. This shortcut allows you to use a local mirror of the repositories, and should improve response times. To setup a kde: shortcut, you should add the following configuration block to ~/.config/git/config. If your network blocks the Git protocol, then you can exchange that for HTTP instead.

[url "https://anongit.kde.org/"]
    insteadOf = kde:
[url "[email protected]:"]
    pushInsteadOf = kde:

Once setup as above, you can clone and push to repositories through the URL kde:group/repository.

As Subversion requires that checkouts you are committing from are made from the same location you are committing to, checkouts should be made from the Subversion server directly. It can be accessed at svn+ssh://[email protected]/home/kde/. If you have existing checkouts, you will need to relocate them using the svn switch command before you are able to commit.

Browsing

To allow for quick review of code, web repository browsers exist for both Git and Subversion repositories. Those interested in browsing Subversion should visit WebSVN, which will contain the latest commits made to the KDE Subversion repository subject to a delay of 10 minutes at maximum.

In the case of Git, repository browsing is available via GitLab. Additionally, all mainline repositories are available on GitHub and can be browsed there. Please note that personal repositories are only browsable on our GitLab, they are not mirrored to GitHub.

If you need to link to materials which are stored in either Git or Subversion repositories on KDE infrastructure, it is requested that you do not embed the content directly, but simply link to it. Embedding content, such as images, causes significantly higher load on the repository browser servers, making it unavailable for others wishing to use it. This is particularly relevant for blog posts on Planet or any other high traffic web page.

New repositories

To allow for free form development in a manner similar to Subversion did, KDE Git allows personal repositories to be created on demand as needed. You can create personal repositories from the GitLab web interface. You can also "fork" an existing official KDE repository.

Personal repositories and forks can be deleted at any time.

From time to time it may be necessary to create new project repositories, to contain newly developed applications, migrate existing applications from Subversion or to bring new projects under the KDE umbrella. New repositories can be requested by filing a ticket, and will be created in the appropriate group on invent.kde.org.

Extra Karma

At times contributors may find it necessary to push or commit to certain repositories or paths which are protected. In this case the server will reject your request with a message such as insufficient karma or access denied. This protection is most often applied to repositories which run parts of the infrastructure such as websites or other crucial components.

If you would like to request access to these protected areas, please file a ticket, mentioning which repositories or paths you are trying to change.

A complete manual on how to use KDE's Git services, along with some best practices, is available on the KDE Community Wiki.

Hooks

Kde provides some git hooks to perform and automatize some actions on push.

Server Fingerprints

The SSH host server key fingerprints are as follows for both Git and Subversion access:

  • RSA-2048 (MD5): f9:54:62:b2:90:f2:dc:08:df:f4:a3:fa:c5:2a:a0:c8
  • RSA-2048 (SHA256): eONstlOUy0LjhlkjK90e1/bm95fOqnz8qcUsijWuP0Q
  • ECDSA-256 (MD5): 23:62:3e:0b:18:f2:5d:e9:66:8a:80:fb:82:53:84:b5
  • ECDSA-256 (SHA256): Bvp9zqBBiEf9QdpX09B0PL2CkDa1B64WtkKZyTq7XhM
  • ED25519-256 (MD5): f3:17:e5:0b:79:16:2b:73:45:fa:5d:23:24:eb:33:40
  • ED25519-256 (SHA256): x8pnmJ/gZmuw68V+wJUlT3MreIzPACzKmd/Ybei9gBA

Resources

Links to useful external sites about Git

Official Documentation

Git for SVN Users

Git books

  • Pro Git - An easy to understand book on git (CC licensed).

Tutorials

  • Git Magic - A good intro to git (in several languages!)

- Essential reading if you want to truly understand git.

  • tryGit A 15 minute online interactive tutorial

KDE's Git Infrastructure

The KDE Git System Administrators Manual is a useful resource for more details on the technical implementation of the KDE Git infrastructure.

For more information on how the KDE Git Repositories are organized, please see the Build from source page.

Other:

  • The new Commit Policy is being reviewed, applied to both SVN and Git.
  • GitHub Mirror has been created and policy is in development (Sep 2015).

KDE Git Recipes

Short recipes for using Git with the KDE infrastructure.

Please see the Git Recipes page.

KDE Git Tutorials

More in-depth instructions in using Git.

Please help filling this section by

  • checking the links at the bottom of the page and see which still have valid content
  • write tutorials yourself

Cheat Sheets

(broken image, get it from Media:Zrusin-git-cheat-sheet-medium.png) </translate>