Is there a glyphspackage/git tutorial in the works?
Definitely work with .glyphspackage as it makes working with version control systems such as Git much nicer.
Git can ignore certain files and I would advice you to ignore the UIState.plist file which stores the display strings. Thus, changing the text in the Edit View tabs makes no difference to Git; only modifications to the font itself are tracked.
Are you looking for an introduction to Git itself, or specific techniques beyond the basics for type design?
This is what tells me I need a better versioning control system!
I’d be looking for a step-by-step for implementing this. Including things like the ignore advice you just gave. (BTW, how do I stop tracking that file now that it’s on my ignore list?) And step-by-step through setting it up (should the repository locally be the folder where I already have all the related files, or a new folder?) and branching to try out new experiments. Does GlyphsCommit work with G3? with .glyphspackages?
This info is probably all out there between forum postings, general google-able guidance, etc., but the Glyphs tutorials are really good at explaining things!
OK, I’ll compile a list of best practices. Watch this space.
Managing Glyphs files with Git
Git is a general-purpose version control system. It keeps track of changes to files, so that one can restore previous revisions, upload revisions to a server for backup, and collaborate with others by merging changes.
Here is an introduction to Git by using the Git client Tower. There are many Git clients, but most of them have the same basic structure and terminology, so the movie also applies to most other Git clients.
Working with Glyphs Packages
A Glyphs file can either be stored as a normal .glyphs file or as a .glypspackage bundle. A .glyphspackage is not a file, although it is presented as one in Finder, but instead a folder filled with many smaller files, one for each glyph. It also contains files for general information such as the name of the font or the order of the glyphs.
When working with Git, using the .glyphspackage format offers several benefits. Create a new file, save it with File → Save (⌘S) and pick Glyphs File Package from the File Format picker.
If you already have an existing Glyphs file, choose File → Save As… (⇧⌘S) and pick Glyphs File Package in the save dialog. Click Save to save as a .glyphspackage.
Picking a Git client
Now that Git is installed, it’s time to use it. Git is a system and it can be used by many different Git clients. A Git client is an app that controls Git. The original Git client is
git in the Terminal. If you are comfortable working with the Terminal, you can use Git directly there.
For most users, however, Git is best used from a real Mac app with buttons and text fields and lists, just like any other Mac app. There are many Git clients, and they are similar for basic Git workflows. Here is a list of Git Clients I can recommend:
- Tower – 70 USD + VAT/year
- This is the app I use. It is not cheap, but I like it a lot.
- Fork – 50 USD
- Works well, a good choice.
- Gitfox – 50 USD/year (also on Setapp)
- A decent choice.
- Gitbox – 15 USD
- Does the basics.
- GitHub Desktop – free
- By GitHub, but also works with other services. Works well.
- Sourcetree – free
- By Atlassian, but also works with other services. Works well.
There are others like GitKrakten, SublimeMerge, and GitUp, among many more. Git apps are complex apps and tend to be priced as such (most offer free trial versions). The two last entries on the list are subsidized by their parent company and thus free. The original
git program in Terminal is also free, but it has a steep learning curve.
Most of the clients look and work similarly. Pick one, it does not matter too much for the start.
Git is not preinstalled on the Mac. Some of the Git clients mentioned above include their own copy of Git, so try to use the Git client first, and if it does not work because “Git is missing”, use one of the following methods to install Git.
- Do you have Xcode installed?
- Great, Git is installed as part of Xcode.
- Do you use Homebrow?
- Run the following on your command line:
brew install git
- None of the above apply?
Launch the Terminal application on your Mac. To do this, click Finder in your Dock, move to mouse cursor to the top of your screen to the menu bar and choose Go → Utilities. The Utilities folder opens. Double-click the Terminal app to launch it.
First, check if Git is installed (it might be without you knowing, since some other apps also install it). Type
type gitand press Return. If you see a message like “git is …”, than Git is already installed. You may skip to the next section.
If the output is “git not found” that Git is not installed on your Mac. Install it by typing
xcode-select --installand press Return. You might be prompted for your Mac password.
This may take a few minutes. Once it’s done, you see your input prompt written again at the bottom of the Terminal window (for me this would be “Florian@Florians-iMac ~ %”). Git is now installed. Confirm by typing
type git, press Return, and check if the output is like “git is …”.
Regarding CommitGlyphs: no, .glyphspackge files are not supported by CommitGlyphs. This is an area of future development. The text based-interface that the Git clients above all use is a common ground for a lot of tooling, especially web services that can only show the text-based interface. So it is still a good idea to familiarize oneself with the text that makes up a Glyphs file, even if it is not as visual as it could be.
Git and source control in general is a broad topic, so feel free to ask if you get stuck somewhere.
Good idea. I’ll put it on my list. I’ll take Florian’s forum post into it.
- save as
.glyphspackage(see Florian’s post)
- add these custom parameters in Font Info > Font:
- Write DisplayStrings NO
- Write lastChange NO
- use the same file name all the time (i.e., do not save daily versions with the date appended etc.)
- if you do want to keep an alternate version of the file (e.g. to be on the safe side if you are undertaking a big change), put it in a different folder
- do not move the file; that way git can record the file history (depends on the path inside the repository)
- Add these to your .gitignore file:
If you just would like to commit your changes to an existing git repo when saving your file, you can use my Save to Git plugin, available on GitHub or the plugin manager.
You can set up your own keyboard shortcut for its menu command, and use that instead of
cmd-S whenever you feel a version should be committed to the repo.
If you have no experience whatsoever with git, you can follow any beginner git tutorial that you find online, even if not aimed at Glyphs particularly (it doesn’t really matter). In a type design workflow, you can go a long way with only the basics, as projects are often less complex — in terms of file structure — than, say, a web project.
I think once you are comfortable with navigating your commit timeline, pushing to and pulling from an online repo, and have a basic understanding of branches, you have most of what you need and can learn about specifics as you go.
Up and running well, thanks to all of your help.
I poured many wasted hours trying to get SourceTree to work with Github, but things are working smoothly with Github Desktop which does nearly everything I need for now (except amending commits).
I highly recommend Fork. I switched to it after years of using SourceTree and then Tower. You can even start using it for free. It is slightly more complex than GitHub Desktop, but is also more powerful (including amending commits).