2010-04-06 18:49:54 -04:00
---
2021-03-13 13:06:18 -05:00
lang: en
2015-04-10 16:17:45 -04:00
layout: doc
2021-06-16 22:56:25 -04:00
permalink: /doc/source-code/
2015-10-11 03:04:59 -04:00
redirect_from:
2015-10-28 18:14:40 -04:00
- /en/doc/source-code/
2015-10-11 03:04:59 -04:00
- /doc/SourceCode/
- /wiki/SourceCode/
2021-03-13 13:06:18 -05:00
ref: 54
2021-06-16 02:19:45 -04:00
title: Source Code
2010-04-06 18:49:54 -04:00
---
2010-04-06 19:35:50 -04:00
2016-03-08 16:50:31 -05:00
All the Qubes code is kept in Git repositories. We have divided the project into
several components, each of which has its own separate repository, for example:
2010-04-06 19:35:50 -04:00
2021-03-13 12:03:23 -05:00
* `core-admin.git` -- The core Qubes infrastructure, responsible for VM
2016-03-08 16:50:31 -05:00
management, VM templates, fs sharing, etc.
2021-03-13 12:03:23 -05:00
* `gui-daemon.git` -- GUI virtualization, Dom0 side.
* `gui-agent-linux.git` -- GUI virtualization, Linux VM side.
* `linux-template-builder.git` -- Scripts and other files used to create Qubes
2016-03-08 16:50:31 -05:00
template images.
2010-04-06 19:35:50 -04:00
2021-04-10 18:09:05 -04:00
All of our repositories are available under the [QubesOS GitHub account ](https://github.com/QubesOS/ ).
2010-04-06 19:35:50 -04:00
To clone a repository:
2015-09-26 19:00:33 -04:00
~~~
2017-11-24 07:19:21 -05:00
git clone https://github.com/QubesOS/qubes-< repo_name > .git < repo_name >
2015-09-26 19:00:33 -04:00
~~~
2010-04-07 05:51:32 -04:00
e.g.:
2015-09-26 19:00:33 -04:00
~~~
2016-04-08 22:13:12 -04:00
git clone https://github.com/QubesOS/qubes-core-admin.git core-admin
2015-09-26 19:00:33 -04:00
~~~
2010-04-06 19:35:50 -04:00
2021-03-13 12:03:23 -05:00
To build Qubes you do not need to download all these repositories.
2021-04-10 18:09:05 -04:00
If you use [qubes builder ](/doc/QubesBuilder/ ) you can specify *what* you want to build, and download only the repositories needed to build that target.
2021-03-13 12:03:23 -05:00
2020-02-20 11:05:11 -05:00
If you really do want to clone **all** of the repositories, you can use these commands:
2016-03-08 16:50:31 -05:00
~~~
2016-04-08 22:13:12 -04:00
curl "https://api.github.com/orgs/QubesOS/repos?page=1& per_page=100" | grep -e 'clone_url*' | cut -d \" -f 4 | xargs -L1 git clone
2020-02-20 11:05:11 -05:00
curl "https://api.github.com/orgs/QubesOS/repos?page=2& per_page=100" | grep -e 'clone_url*' | cut -d \" -f 4 | xargs -L1 git clone
2016-03-08 16:50:31 -05:00
~~~
2020-02-20 11:05:11 -05:00
To update (git fetch) **all** of these repositories :
2016-03-08 16:50:31 -05:00
~~~
find . -mindepth 1 -maxdepth 1 -type d -exec git -C {} fetch --tags --recurse-submodules=on-demand --all \;
~~~
(Alternatively, you can pull instead of just fetching.)
How to Send Patches
-------------------
2021-04-10 18:09:05 -04:00
If you want to [contribute code ](/doc/contributing/#contributing-code ) to the project, there are two ways. Whichever
method you choose, you must [sign your code ](/doc/code-signing/ ) before it can be accepted.
2016-03-08 16:50:31 -05:00
2021-04-10 18:09:05 -04:00
* **Preferred**: Use GitHub's [fork & pull requests ](https://guides.github.com/activities/forking/ ).
2016-11-20 00:28:36 -05:00
Opening a pull request on GitHub greatly eases the code review and tracking
process. In addition, especially for bigger changes, it's a good idea to send
2021-04-10 18:09:05 -04:00
a message to the [qubes-devel mailing list ](/support/#qubes-devel ) in order to notify people who
2016-11-20 00:28:36 -05:00
do not receive GitHub notifications.
2021-04-10 18:09:05 -04:00
* Send a patch to the [qubes-devel mailing list ](/support/#qubes-devel ) (`git format-patch`).
2016-03-08 16:50:31 -05:00
1. Make all the changes in your working directory, i.e. edit files, move them
around (you can use 'git mv' for this), etc.
2. Add the changes and commit them (`git add`, `git commit` ). Never mix
different changes into one commit! Write a good description of the commit.
The first line should contain a short summary, and then, if you feel like
more explanations are needed, enter an empty new line, and then start the
long, detailed description (optional).
3. Test your changes NOW: check if RPMs build fine, etc.
4. Create the patch using `git format-patch` . This has an advantage over
`git diff` , because the former will also include your commit message, your
name and email, so that *your* name will be used as a commit's author.
5. Send your patch to `qubes-devel` . Start the message subject with
`[PATCH]` .
2015-07-19 12:41:14 -04:00