PatrickDattilio / git-sketch-plugin

A Git client generating pretty diffs built right into Sketch.

Home Page:https://mathieudutour.github.io/git-sketch-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-sketch-plugin

A Git client built right into Sketch. Generate pretty diffs so that everybody knows what are the changes!

From ... Ugly

... To Pretty

screen cast

Requirements

  • Sketch >= 3.4 (not with the sandboxed version ie from the App Store).
  • Git (coming with OS X so you shouldn't have to do anything)

Installation

  • Download this repo as a zip
  • Double-click on Git.sketchplugin

Workflow

Once:

  • Init the git repo (Plugins > Git > Advanced > Init git repo)
  • Add all the sketch files you are working on the repo (Plugins > Git > Advanced > Add file to git)

Then:

  • Create a new branch when you start working on a new feature (Plugins > Git > New branch)
  • Work normally on your design
  • Save the file
  • Commit the changes with a meaningful message describing them. The plugin will extract the artboards in your file in order to show the differences easily. (Plugins > Git > Commit)
  • Push your changes to the remote. (Plugins > Git > Push)
  • Create a pull request from your branch to the master branch.
  • Voila. Your co-workers can review the changes, comment on them and approve them. Once approved, merge the pull request.

For a more in-depth explanation of a nice git flow, check out this article.

Enabling Git LFS (optional)

Git LFS is an extension for git that enables a quicker way to push and pull changes that involve binary files, like .png and .sketch. It is not critical to using this plugin, but it may help maintain a healthy git repository.

Note: In using the Git LFS extension, all contributors must have it installed, and the git remote (ie Github, Bitbucket, Gitlab) must have it enabled with sufficient storage available to the hosting account.

Start by enabling LFS for your repo:

  1. Downloading and install Git LFS to your machine
  2. Go into the terminal for your repo (through Sketch, Plugins > Git > Advanced > Open terminal)
  3. Paste the following into your repo, git lfs install && git lfs track '*.png' && git lfs track '*.sketch' && git add .gitattributes
  4. Thats it. You need only run these commands once. Your team mates will have to download and install Git LFS onto their machines as well (so, just step 1).

Default key bindings

Action Shortcut
Commit your changes ctrl + alt + cmd + c
Push your changes ctrl + alt + cmd + p
Create a new branch ctrl + alt + cmd + n
Switch to an existing branch ctrl + alt + cmd + o

Git command behind

Client Command
Commit git commit -m 'message' -a
Push git -c push.default=current push -q
New Branch git checkout -qb branchName
Switch Branch git checkout -q branchName
Pull git pull
Add file to git git add currentFile
Init Git repo git init && git add currentFile

License

MIT

About

A Git client generating pretty diffs built right into Sketch.

https://mathieudutour.github.io/git-sketch-plugin


Languages

Language:JavaScript 100.0%