GitHub repositories

Counterpunch can open fonts directly from GitHub repositories and save your edits back as commits and pull requests. Public repositories open without signing in or setting up a token; Counterpunch asks you to sign in only when you save, or when you open a private repository.

See The launcher and where fonts live for how GitHub sits alongside This computer, Cloud, and Browser storage.

Opening fonts without signing inlink

In the launcher’s GitHub group, click Add repository or URL… and enter either owner/repo or any GitHub URL:

  • A repository (https://github.com/owner/repo)
  • A branch or subfolder (…/tree/feature-branch/sources)
  • A direct font file or package (…/blob/main/sources/Font.glyphs, or a raw.githubusercontent.com link)
  • A pull request (…/pull/42)
  • A release tag (…/releases/tag/v1.2.0) or a specific commit (…/commit/a1b2c3d)

If you paste a direct link to a font file, Counterpunch adds the repository and opens the font right away.

You can link straight to a font, branch, pull request, tag, commit, or repository on GitHub so anyone can open it in Counterpunch with one click — for example, in a repository’s README.md, an issue, or a pull request comment.

Prefix any normal GitHub URL with https://editor.counterpunch.space/?file=:

  • A font file or package: https://editor.counterpunch.space/?file=https://github.com/owner/repo/blob/main/sources/Font.glyphs https://editor.counterpunch.space/?file=https://github.com/owner/repo/tree/main/sources/Font.ufo
  • A branch whose name contains slashes: https://editor.counterpunch.space/?file=https://github.com/owner/repo/blob/feature/bold/sources/Font.glyphs
  • A pull request (same-repo or fork PR): https://editor.counterpunch.space/?file=https://github.com/owner/repo/pull/42
  • A specific commit or release tag: https://editor.counterpunch.space/?file=https://github.com/owner/repo/commit/a1b2c3d https://editor.counterpunch.space/?file=https://github.com/owner/repo/releases/tag/v1.2.0
  • A whole repository or subfolder: https://editor.counterpunch.space/?file=https://github.com/owner/repo https://editor.counterpunch.space/?file=https://github.com/owner/repo/tree/main/sources
  • A raw.githubusercontent.com file link: https://editor.counterpunch.space/?file=https://raw.githubusercontent.com/owner/repo/main/sources/Font.glyphs

When a link points to a repository, folder, pull request, tag, or commit rather than a single font, Counterpunch opens the font automatically if there is only one, or shows a quick picker if there are several.

You can also use the short github:// form (github://owner/repo/path/inside/repo), with an optional @branch:, @pr:, @tag:, or @commit: ref after the repository name:

https://editor.counterpunch.space/?file=github://owner/repo/sources/Font.glyphs
https://editor.counterpunch.space/?file=github://owner/repo@pr:42/sources/Font.ufo
https://editor.counterpunch.space/?file=github://owner/repo@branch:feature%2Fbold/sources/Family.designspace
https://editor.counterpunch.space/?file=github://owner/repo@tag:v1.2.0/sources/Font.glyphs
https://editor.counterpunch.space/?file=github://owner/repo@commit:a1b2c3d/sources/Font.glyphs

Branches, pull requests, tags, and commitslink

Click Open… in the launcher’s GitHub group to browse your added repositories. Each repository has a selector for its branches, open pull requests (including draft PRs and cross-repository fork PRs), and tags. Switching it reloads the font list for that exact version.

Each branch, pull request, tag, or commit gets its own window identity, so you can keep main and a pull request open side by side in separate windows. Recent fonts in the launcher remember which branch, PR, tag, or commit they came from.

Single files and multi-file sourceslink

GitHub support works for both single-file formats (.glyphs, .babelfont) and multi-file folder sources (.ufo, .designspace with multiple UFOs, and .glyphspackage).

When you edit a .ufo, .designspace, or .glyphspackage and save, Counterpunch uploads only the files that changed, were added, or were deleted, and bundles them into a single commit. Very large repositories whose full file tree is too big for GitHub to list at once (such as google/fonts) can still be opened by pasting a direct GitHub URL to the font or its folder.

Signing in and savinglink

You need a GitHub sign-in only when you save (Cmd/Ctrl+S or File → Save As… → GitHub) or open a private repository. One sign-in serves the whole editor:

  • Connect GitHub signs in through GitHub in a popup.
  • Use an access token accepts a pasted fine-grained personal access token with Contents and Pull requests set to Read and write. This is useful if your organisation restricts OAuth apps.

If you are signed out (or your sign-in expired) when you press Cmd/Ctrl+S, Counterpunch asks you to sign in right inside the font window and then continues the save. Cancelling leaves your edits safely in the window.

Choosing where a save goeslink

On the first save in a window, Counterpunch asks where to send your commit based on what you opened and your permissions on the repository:

  • Commit directly to the current branch, or to an open pull request’s branch (including fork PRs you can push to).
  • Create a new branch (your own name, or counterpunch-1, counterpunch-2, … automatically), with options to open a regular or Draft pull request against any base branch.
  • Fork and open a pull request when you do not have push access to a public repository. Counterpunch forks the repository on GitHub’s servers (syncing an existing fork with upstream first), pushes your branch to your fork, and opens a pull request back to the upstream repository. Nothing extra is downloaded to your browser.

Fonts opened from a read-only ref — a tag, a commit SHA, or a closed pull request — always guide you to save to a new branch (or a fork).

After you pick a target on the first save, later Cmd/Ctrl+S saves in the same window commit straight to that branch with an automatic message naming what changed (up to five glyph names, a count for more, “font data” for font-level changes, or “Update ” for full saves).

If someone else pushed to the branch while you were editing, GitHub refuses a non-fast-forward update; Counterpunch keeps your edits and lets you save them to a new branch instead.

Save As to GitHublink

Choose File → Save As… and pick GitHub. You can select one of your added repositories or type any owner/repo, pick a folder inside it, and save in any writable format (.glyphs, .glyphspackage, .ufo, .designspace, or .babelfont). If you are not signed in yet, Counterpunch asks you to sign in before saving.

Rate limitslink

GitHub limits anonymous API requests to 60 requests per hour per IP address, and signed-in requests to 5 000 requests per hour.

To avoid burning through the anonymous limit on multi-file fonts, Counterpunch reads public font files from raw.githubusercontent.com, which does not count against the API limit. Opening a 1 000-glyph .ufo or .designspace from a public repository uses only one or two API requests.

When file reads must go through the GitHub API (for private repositories, or if raw reads are blocked), Counterpunch counts how many files a .ufo, .designspace, or .glyphspackage needs before starting and warns you upfront if your remaining hourly quota is too low. Whenever an anonymous rate limit is hit, the alert shows when the limit resets and offers Connect GitHub or Use an access token so you can sign in and continue right away.

Signing outlink

Click your GitHub account in the launcher’s GitHub group title and choose Sign out. Signing out removes the token from this browser only — public repositories remain openable, and your account’s repository list comes back when you sign in again. To revoke Counterpunch’s access to your GitHub account completely, remove it on GitHub’s Applications page.