How does it work?
That's a good question. Instead of tracking the actual sketch files (or binaries) in git, Kactus transforms your sketch file into groups of individual text files – one for each layer/page – that are much more suited for git
to work with.
Workflow
The basic workflow looks very similar to how many developers use git
:
- Clone your repo locally
- Make your changes in Sketch
- Commit your changes
- Push your changes
However, when working with multiple designers, the git-flow methodology works very well:
- Clone your repo (if you're just getting started)
- Checkout a feature branch (e.g.
feat/background-color
) - Make your changes in Sketch
- Commit your changes
- Either:
- Push your changes to your git server for others to review/merge
- Merge your changes into another branch (master) yourself
Committing Changes
When Kactus is running (with your repository open), it watches your sketch files and re-parses them when a change is detected. This parsed (or exploded) view of your sketch file is what git tracks.
Merging two parallel branches
- Checkout the branch you want to merge into
- Select "Merge into Current Branch" from the "Branch" menu
- Select the branch that you want to merge from
Sharing text styles across multiple sketch files
Existing Repos
If your sketch files are already tracked in a git repository, there are few things you need to do to get the most out of Kactus.
- Open your repo in Kactus to generate the JSON representation of your sketch files
- Commit the generated JSON directories
- Untrack sketch files. In most cases, this can be done with git by running:
git rm --cached *.sketch
- Tell git to ignore sketch files by adding
*.sketch
to your repo's.gitignore
file (create it if it doesn't exist)
Note: When you create a new repository with Kactus, it is automatically configured to ignore sketch files.