Infrastructure/Git: Difference between revisions

From KDE Community Wiki
No edit summary
m (remove dead link)
 
(42 intermediate revisions by 21 users not shown)
Line 1: Line 1:
<languages />
[[Category:Needs Attention]]
<translate>
 
<!--T:1-->
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.


== KDE and Git == <!--T:3-->
<!--T:4-->
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.
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.


<!--T:5-->
== Git at KDE ==
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.
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.


<!--T:91-->
=== Anonymous access ===
For more information on how the KDE Git Repositories are organized, please see the [[Getting_Started/Sources|Sources]] page or the [https://projects.kde.org/projects KDE Git Projects] page.


<!--T:92-->
Both Git and Subversion repositories can be accessed anonymously by anyone. This access takes place from https://invent.kde.org/ 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.
Please note that some KDE modules are still using SVN, for more details read the [[Getting_Started/Sources/Using_Subversion_with_KDE|Using Subversion with KDE]] page.


=== KDE Git Configuration === <!--T:6-->
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. Code changes should use the official KDE git repositories https://invent.kde.org/. And still, GitHub may be used / searched more intuitively than the alternatives. E.g. sign into github.com, then search for source code in the entire "KDE" organization with a URL such as https://github.com/search?q=org%3AKDE+KMessageBox Then click on "Code" or "Commits".


<!--T:7-->
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].
How to configure Git for use with the KDE infrastructure.


<!--T:8-->
=== Pushing ===
Please see the [[Special:myLanguage/Infrastructure/Git/Configuration|Git Configuration page]].


=== KDE Git Policies === <!--T:10-->
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.


<!--T:11-->
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.
KDE policies on Git.  More generic development policies go elsewhere.


No formal workflow policy currently exists, but a number of draft proposals have been made:
<pre>[url &quot;https://invent.kde.org/&quot;]
* [[Infrastructure/Git/Simple_Workflow]]
    insteadOf = kde:
* [[Infrastructure/Git/Feature_Branch_Workflow]]
[url &quot;[email protected]:&quot;]
* [[Infrastructure/Tutorials/Git/Feature_Development_Workflow]]
    pushInsteadOf = kde:</pre>
* http://community.kde.org/Frameworks/Git_Workflow
Once setup as above, you can clone and push to repositories through the URL <code>kde:group/repository</code>.


The SVN Commit Policy is being reviewed to be replaced with a new Commit Policy applying to both SVN and Git:
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.
* [[Policies/SVN_Commit_Policy]]
* [[Policies/Draft/Commit_Policy]]


=== KDE Git Recipes === <!--T:12-->
=== Browsing ===


<!--T:13-->
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.
Short recipes for using Git with the KDE infrastructure.


<!--T:14-->
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.
Please see the [[Special:myLanguage/Infrastructure/Git/Recipes|Git Recipes page]].


=== KDE Git Tutorials === <!--T:16-->
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.


<!--T:17-->
=== New repositories ===
More in-depth instructions in using Git.


<!--T:18-->
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.
* [[Special:myLanguage/Infrastructure/Tutorials/Git/GitQuickStart|A quick step-by-step guide for getting started]]


<!--T:19-->
Personal repositories and forks can be deleted at any time.
* [[Special:myLanguage/Infrastructure/Tutorials/Git/Create a patch|Creating a patch]]


<!--T:20-->
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.
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


== External Git Resources == <!--T:21-->
=== Extra Karma ===


<!--T:22-->
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.
Links to useful external sites about Git


=== Official Documentation === <!--T:23-->
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.


<!--T:24-->
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].
* [http://git-scm.com/documentation Links to git official documentation]


=== Git for SVN Users === <!--T:25-->
=== Hooks ===
Kde provides some [[/Hooks |git hooks]] to perform and automatize some actions on push.


<!--T:26-->
=== Server Fingerprints ===
* [http://git-scm.com/course/svn.html The git-svn Crash Course]
The SSH host server key fingerprints are as follows for both Git and Subversion access:


=== Git books === <!--T:27-->
* '''ED25519-256 (SHA256)''': <code>zHdK2R/S6s5Oj71N0s8LHWCXXsUt+DCztd+GjzW9KlU</code>
* '''ECDSA-256 (SHA256)''': <code>ZNBg4AkRxbt/N6xzpt7GbmmS78A3WFy5lz0l/cPHbcE</code>
* '''RSA-3072 (SHA256)''': <code>KxAoV6VsbKvAocFZCJlxtmPDScmUCRNiUiOCSXNSC/k</code>


<!--T:28-->
([https://mail.kde.org/pipermail/kde-devel/2023-July/001895.html Changed July 23, 2023])
* [http://progit.org/book/ Pro Git] - An easy to understand book on git (CC licensed).


<!--T:30-->
== Resources ==
* [http://book.git-scm.com/ The git community book], also as a [http://book.git-scm.com/book.pdf pdf]


=== Tutorials === <!--T:32-->
Links to useful external sites about Git


<!--T:33-->
=== Official Documentation ===
* [http://www-cs-students.stanford.edu/~blynn/gitmagic/ Git Magic] - A good intro to git (in several languages!)


<!--T:35-->
* [http://git-scm.com/documentation Links to git official documentation]
*[http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable]
- Essential reading if you want to truly understand git.


<!--T:37-->
=== Git books ===
* [http://www.gitcasts.com/ Git Screencasts]


=== Cheat Sheets === <!--T:38-->
* [http://progit.org/book/ Pro Git] - An easy to understand book on git (CC licensed).


<!--T:39-->
* [http://book.git-scm.com/ The git community book], also as a [http://book.git-scm.com/book.pdf pdf]
* [http://cheat.errtheblog.com/s/git Quick reference]


<!--T:40-->
=== Tutorials ===
* [http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html Illustrated git cheat sheet]
(broken image, get it from [[Media:Zrusin-git-cheat-sheet-medium.png]])


= Documentation Changes = <!--T:42-->
* [http://www-cs-students.stanford.edu/~blynn/gitmagic/ Git Magic] - A good intro to git (in several languages!)


== KDE Documentation Review == <!--T:43-->
*[http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable]


=== Existing Pages For Review === <!--T:44-->
* [http://try.github.io/ tryGit] A 15 minute online interactive tutorial


<!--T:45-->
=== KDE's Git Infrastructure ===
Existing KDE pages about Git, SVN, and/or buildinga 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.


<!--T:46-->
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.
Keep:


<!--T:47-->
For more information on how the KDE Git Repositories are organized, please see the [[Guidelines_and_HOWTOs/Build_from_source|Build from source]] page.
* [[Special:myLanguage/Infrastructure/Tutorials/Git/Basics|Basics]]


<!--T:48-->
Other:
* [[Special:myLanguage/Infrastructure/Tutorials/Git/git-svn|Git-svn]]
* 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).


<!--T:49-->
=== KDE Git Recipes ===
* [[Special:myLanguage/Infrastructure/Tutorials/Git/kde-qt| Kde-qt]]


<!--T:50-->
Short recipes for using Git with the KDE infrastructure.
* [[Special:myLanguage/Getting Started/Sources/Amarok Git Tutorial| The Amarok Git Tutorial]]


<!--T:51-->
Please see the [[Special:myLanguage/Infrastructure/Git/Recipes|Git Recipes page]].
On community.kde.org:


<!--T:52-->
=== KDE Git Tutorials ===
* [http://community.kde.org/Sysadmin/GitKdeOrgManual Git-KDE Manual]


<!--T:53-->
More in-depth instructions in using Git.
* [http://community.kde.org/20110213_GitWorkflowAgenda Git Workflow Agenda]


<!--T:54-->
* [[Special:myLanguage/Infrastructure/Tutorials/Git/GitQuickStart|A quick step-by-step guide for getting started]]
* [http://community.kde.org/20110213_GitWorkflowAgenda/StevesIdea Git Workflow Agenda, Steve's Idea]


<!--T:55-->
* [[Special:myLanguage/Infrastructure/Tutorials/Git/Create a patch|Creating a patch]]
On techbase.kde.org:


<!--T:56-->
Please help filling this section by
* [[Special:myLanguage/Getting Started|Getting Started]]
* checking the links at the bottom of the page and see which still have valid content
 
* write tutorials yourself
<!--T:57-->
* [[Special:myLanguage/Getting Started/Build/KDE4| Build KDE 4]]
 
<!--T:58-->
* [[Special:myLanguage/Getting Started/Build/KDE4.x|Build KDE 4.x]]
 
<!--T:59-->
* [[Special:myLanguage/Getting Started/Build/KDE4/Prerequisites|Prerequisites]]
 
<!--T:60-->
* [[Special:myLanguage/Getting Started/Build/KDE4/Windows/subversion|Subversion on Windows]]
 
<!--T:61-->
* [[Special:myLanguage/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts|Increase Productivity with Scripts]]
 
<!--T:62-->
* [[Special:myLanguage/Getting_Started/Build/kdesrc-build|Kdesrc-build]]
 
<!--T:63-->
* [[Special:myLanguage/Getting Started/Sources/Anonymous SVN|Anonymous SVN]]
 
<!--T:64-->
* [[Special:myLanguage/Getting_Started/Sources/Using_Subversion_with_KDE|Subversion with KDE]]
 
<!--T:65-->
* [[Special:myLanguage/Getting_Started/Using_an_IDE_with_KDE4|Using an IDE with KDE 4]]
 
<!--T:66-->
* [[Special:myLanguage/Policies/SVN_Commit_Policy|SVN Commit Policy]]
 
<!--T:67-->
* [[Special:myLanguage/Policies/SVN_Guidelines|SVN Guidelines]]
 
<!--T:68-->
* [[Special:myLanguage/Infrastructure/Tools|Development Tools]]
 
<!--T:69-->
* [[Special:myLanguage/Infrastructure/Tutorials/Git/Recipes|Git Recipes]]
 
<!--T:70-->
* [[Special:myLanguage/Infrastructure/Tutorials/Git/decoding-git|Decoding Git]]
 
<!--T:71-->
* [[Special:myLanguage/Projects/rekonq/Git_with_rekonq_HowTo|Git with Rekonq How-to]]
 
<!--T:72-->
* [[Special:myLanguage/Projects/Related/Subversion|Subversion]]
 
<!--T:73-->
* [[Special:myLanguage/Projects/MovetoGit|Move to Git]]
 
<!--T:74-->
* [[Special:myLanguage/Projects/MoveToGit/StepsToMove|Steps to Move]]
 
<!--T:75-->
* [[Special:myLanguage/Contribute/Get a SVN Account|Get a SVN Account]]
 
<!--T:76-->
* [[Special:myLanguage/Contribute/First Steps with your KDE SVN Account|First Steps with your KDE SVN Account]]
 
<!--T:77-->
There are also numerous other pages referring to "the KDE SVN/subversion repositories" which should be replaced with the generic "KDE code repositories".
 
<!--T:78-->
There are also numerous translated pages which will need to be updated once the original pages are completed.
 
=== New Page Structure === <!--T:79-->
 
<!--T:80-->
* [[Special:myLanguage/Getting_Started|Getting Started]]
 
<!--T:81-->
* [[Special:myLanguage/Getting_Started/Build|Getting_Started/Build]]
 
<!--T:82-->
* [[Special:myLanguage/Getting_Started/Build/Environment|Getting_Started/Build/Environment]]
 
<!--T:83-->
* [[Special:myLanguage/Getting_Started/Build/Requirements|Getting_Started/Build/Requirements]]
 
<!--T:84-->
* [[Special:myLanguage/Getting_Started/Build/Qt|Getting_Started/Build/Q]]
 
<!--T:85-->
* [[Special:myLanguage/Getting_Started/Build/KdeSupport|Getting_Started/Build/KdeSupport]]
 
<!--T:86-->
* [[Special:myLanguage/Getting_Started/Build/Windows|Getting_Started/Build/Windows]]
 
<!--T:87-->
* [[Special:myLanguage/Getting_Started/Build/Mac_OS_X|Getting_Started/Build/Mac_OS_X]]
 
<!--T:88-->
* [[Special:myLanguage/Getting_Started/Run/Shell|Getting_Started/Run/Shell]]


<!--T:89-->
=== Cheat Sheets ===
* [[Special:myLanguage/Getting_Started/Run/Nested_Session|Getting_Started/Run/Nested_Session]]


<!--T:90-->
* [[Media:Zrusin-git-cheat-sheet-medium.png|Illustrated git cheat sheet]]
* [[Special:myLanguage/Getting_Started/Run/Full_Session|Getting_Started/Run/Full_Session>]]
* [https://cheat.errtheblog.com/s/git Old quick reference]
</translate>

Latest revision as of 11:52, 21 February 2024


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 https://invent.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.

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. Code changes should use the official KDE git repositories https://invent.kde.org/. And still, GitHub may be used / searched more intuitively than the alternatives. E.g. sign into github.com, then search for source code in the entire "KDE" organization with a URL such as https://github.com/search?q=org%3AKDE+KMessageBox Then click on "Code" or "Commits".

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://invent.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:

  • ED25519-256 (SHA256): zHdK2R/S6s5Oj71N0s8LHWCXXsUt+DCztd+GjzW9KlU
  • ECDSA-256 (SHA256): ZNBg4AkRxbt/N6xzpt7GbmmS78A3WFy5lz0l/cPHbcE
  • RSA-3072 (SHA256): KxAoV6VsbKvAocFZCJlxtmPDScmUCRNiUiOCSXNSC/k

(Changed July 23, 2023)

Resources

Links to useful external sites about Git

Official Documentation

Git books

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

Tutorials

  • Git Magic - A good intro to git (in several languages!)
  • 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