Skip to content
174 linesCodeBlameRaw
1---
2title: GitHub
3description: Sign in with GitHub, link your account, and import repositories from GitHub through g1t's GitHub App.
4---
5
6g1t has one GitHub App, [g1t-sh](https://github.com/apps/g1t-sh). It does two
7things: it signs you in with your GitHub account, and, once you install it
8on a GitHub account or organization, it lets g1t read the repositories you
9choose there and bring them across.
10
11## Sign in with GitHub
12
131. On [g1t.sh/login](https://g1t.sh/login) or
14 [g1t.sh/register](https://g1t.sh/register), choose **Continue with GitHub**.
152. GitHub asks you to authorize g1t. Choose **Authorize**.
163. You are back on g1t, signed in.
17
18The first time, g1t makes your account:
19
20- **Username**: your GitHub login, in its own case, if it is free in any
21 case and follows g1t's rules (letters, digits and single hyphens, up to
22 39 characters; see [creating an account](/guides/authentication/#creating-an-account)).
23 Otherwise you choose one.
24- **Email**: the primary address on your GitHub account, if GitHub says it
25 is verified. Only verified addresses count, and GitHub's
26 `@users.noreply.github.com` relay addresses are not used. Your email is
27 confirmed already, so there is no link to follow.
28- **Password**: none. Sign in with GitHub, or set a password later with
29 [Forgot your password](https://g1t.sh/forgot).
30
31Anyone can create an account with GitHub: choose **Continue with GitHub**
32on [g1t.sh/register](https://g1t.sh/register). If someone invited you into
33a workspace or onto a repository, open their invite link and choose
34**Continue with GitHub** there instead, so the new account gets the
35invitation.
36
37Signing in with GitHub does not start a trial or give your workspace
38compute. That works as it does for any account: see
39[usage and billing](/guides/usage-and-billing/).
40
41### If an account already has your email
42
43If one of your verified GitHub addresses belongs to a g1t account that is
44not linked to GitHub, g1t does not link them on its own: owning the GitHub
45account does not prove you own the g1t one. g1t shows **An account with
46this email exists. Sign in to link GitHub**. Sign in to that account with
47its password, and GitHub is linked to it. From then on, **Continue with
48GitHub** signs you in to it.
49
50The offer lasts 30 minutes. If you sign in to a different account in that
51time, GitHub is linked to the account you signed in to.
52
53## Link and unlink GitHub
54
55In [Settings → GitHub](https://g1t.sh/settings/github):
56
57- **Link GitHub** sends you to GitHub and links the account you authorize.
58 One GitHub account links to one g1t account, and the other way round.
59- **Unlink** removes the link and ends g1t's authorization on GitHub. It is
60 refused while GitHub is the only way you sign in: set a password first.
61- **Link again** appears when g1t's access to your GitHub account has
62 ended, for example because you revoked it on GitHub. Linking again is
63 needed to import repositories, not to sign in.
64
65g1t identifies your GitHub account by its numeric id, not its login, so
66renaming yourself on GitHub keeps the link. Signing in, linking and
67unlinking are recorded in the [audit log](/guides/audit-log/) of each
68workspace you belong to, as `github.sign_in`, `github.linked` and
69`github.unlinked`.
70
71## Import a repository
72
731. Choose **New project**, then **Import from GitHub**. You can also go to
74 `g1t.sh/new/github`.
752. If your GitHub account is not linked yet, choose **Connect GitHub**.
763. If no GitHub account is connected to the workspace, a workspace owner
77 chooses **Install on GitHub**, picks the GitHub account or organization,
78 and chooses which repositories the app may see. GitHub returns you to
79 g1t, which records the installation for the workspace. If the app is
80 installed on GitHub already, add it instead: see
81 [already installed the app on GitHub](#already-installed-the-app-on-github).
824. Tick the repositories to bring across. You see only repositories that
83 both you and the app can reach.
845. Choose whether to copy their issues.
856. Choose **Bring to g1t**.
86
87Each repository becomes a repository on g1t with the same name, private if
88it is private on GitHub, and a [project](/guides/projects/) of its own. It
89is copied once: the g1t repository is then its own, and you push to g1t.
90Nothing on GitHub changes.
91
92### Already installed the app on GitHub?
93
94g1t adds an installation to a workspace when GitHub sends you back to g1t
95after you install the app. If you installed it on GitHub directly, in
96another browser, or the return to g1t was lost, add it from g1t instead:
97
981. Make sure your GitHub account is linked: **Connect GitHub** on the import
99 page, or **Link GitHub** in [Settings → GitHub](https://g1t.sh/settings/github).
1002. Open `g1t.sh/new/github?workspace=<workspace>`.
1013. Under **Already installed on GitHub**, choose **Add to** the workspace
102 beside the GitHub account or organization.
103
104Only a workspace owner can add one, and only an installation your own
105GitHub account can see: on your account, or on an organization you belong
106to.
107
108If GitHub sends you to g1t after an installation that did not start from
109g1t, g1t asks which of the workspaces you own to add it to. It is the same
110check: the installation must be one your GitHub account can see.
111
112### What comes across
113
114| | |
115| --- | --- |
116| Every branch and tag | Yes, with full history |
117| Issues | When **Copy issues too** is ticked: up to 200, oldest first, open or closed as on GitHub, with their labels (up to 10 each) |
118| Who opened an issue | Named in the issue: by their g1t username if they have linked GitHub, otherwise by their GitHub login. The issue itself is opened by you. |
119| Milestones | Named in each issue; g1t has no milestones |
120| Issue numbers | New numbers on g1t; each issue links to the original |
121| Comments on issues | No |
122| Pull requests | No. Their branches come across; open pull requests stay on GitHub. |
123| GitHub Actions workflows | Yes, as files. Rename `.github` to `.g1t` to run them on g1t: see [GitHub Actions](/guides/actions/). |
124| Releases, wikis, Git LFS objects | No |
125
126A repository is copied in one piece of at most 40 MB, after compression.
127Push a larger one with git instead: see [git](/guides/git/).
128
129## What g1t's GitHub App can do
130
131| Permission | Access | Why |
132| --- | --- | --- |
133| Contents | Read | Clone the repositories you choose. |
134| Metadata | Read | Required by GitHub for every app: names, visibility, and whether a branch is protected. |
135| Issues | Read | Copy issues when you ask. |
136| Email addresses (account) | Read | Find your verified email when you sign in. |
137
138The app only ever sees the repositories you or your organization's owners
139choose on GitHub. g1t keeps your GitHub user token, which expires every 8
140hours, and its refresh token, encrypted at rest, and uses them only to list
141your installations and repositories. Repository access uses short-lived
142installation tokens, which g1t gets as the app when it needs one.
143
144## Revoke or uninstall
145
146- **Stop signing in with GitHub**: unlink it in Settings, or revoke **g1t**
147 in GitHub under **Settings → Applications → Authorized GitHub Apps**.
148 Revoking on GitHub ends g1t's access at once; you can still sign in with
149 GitHub afterwards, which authorizes g1t again.
150- **Stop g1t reading repositories**: uninstall the app in GitHub under
151 **Settings → Applications → Installed GitHub Apps** (for an organization,
152 its settings). Repositories already imported stay on g1t.
153- **Change which repositories it sees**: **Choose repositories on GitHub**
154 beside the account on the import page.
155
156## The webhook
157
158GitHub tells g1t about installations and repository changes at
159`POST https://api.g1t.sh/hooks/github`. g1t checks each delivery's
160`X-Hub-Signature-256` against the app's webhook secret, ignores a delivery
161id it has already seen (`X-GitHub-Delivery`), and answers `202` before
162acting on it.
163
164| Answer | When |
165| --- | --- |
166| `202` | Received; acted on afterwards |
167| `200` | A delivery already received |
168| `400` | No `X-GitHub-Delivery`, or a body that is not JSON |
169| `401` | Not signed with the app's webhook secret |
170| `404` | No GitHub App is configured on this g1t |
171| `413` | A body over 10 MB |
172
173On your own g1t, register an app of your own: see
174[run g1t yourself](/guides/self-hosting/#sign-in-with-github-and-import-from-github).