Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Quickly update Git and Subversion projects and their dependencies with a single command.

One command is all you need to update local repositories and their submodules. If a project is using CocoaPods or Composer to manage its dependencies, Pug will automatically update those, too.


  1. Installation
  2. Basics
  3. Update
  4. Configuration
  5. Tips
  6. Help



Installing Fig with Homebrew is a snap:

$ brew tap ashur/pug
$ brew install pug

That's it! Installing future updates is also a cinch:

$ brew upgrade pug


You can also install Pug using Git. First, clone this repository:

$ cd ~/tools
$ git clone --recursive

šŸŽ‰ New in v0.7

Next, run the install command and include a directory that's already on your $PATH:

$ pug/bin/pug install /usr/local/bin
Linked to '/usr/local/bin/pug'

This will symlink the pug executable, letting you run pug from anywhere on the command line:

$ cd ~/Desktop/
$ pug --version
pug version 0.7.0


Pug requires PHP 5.4 or greater


šŸŽ‰ New in v0.5

If you're upgrading from v0.5 or later, use the built-in command to fetch the latest version:

$ pug upgrade

If you're upgrading from v0.4 or earlier, the best way to handle all the submodules and fiddly bits is with Pug itself:

$ cd ~/tools/pug
$ pug up

šŸ’” Tip ā€”Ā Not sure which version you're running?

$ pug --version
pug version 0.7.0

Nice. šŸ˜


After you've installed Pug, try updating a local Git repository at any path:

$ pug update ~/Developer/tapas
Updating '/Users/ashur/Developer/tapas'...

 ā€¢ Pulling...
   > Already up-to-date.

 ā€¢ Updating submodules... done.

By default, pug update performs two operations on the repository:

  • git pull
  • git submodule update

šŸ”¬ Learn more about the specifics of what Pug does during an update. You can re-configure the default behavior on a global or per-repository basis. See Configuration for more information.

Using Pug to update repositories at an arbitrary path is nice, but projects make things even easier.


First, let's add a repository to our list of tracked projects:

$ pug add plank ~/Developer/plank
* plank

Now we can grab updates using the project name instead of the full path:

$ pug update plank

That's nicer! Let's add a few more projects:

$ pug show
* plank
* prompt
* transmit

With a single command, we can update multiple projects and their submodules.

$ pug update all


Need to focus on a subset of your projects for a while? Disable anything you don't need:

$ pug disable prompt
* plank
* transmit

Pug will hold on to the project definition, but skip it when you update all:

$ pug update all
Updating 'plank'...

 ā€¢ Pulling...
   > Already up-to-date.

Updating 'transmit'...

 ā€¢ Pulling...
   > Already up-to-date.

   ā€¢ Updating submodules... done.


šŸŽ‰ New in v0.6

As the list of tracked projects grows, it can get harder to stay organized:

$ pug show
* ansible
* cios
* dotfiles
* mlib
* tapas
* tios
* transmit
* zoo

Groups help keep things nice and tidy. To add a new project to a group, use the <group>/<project> naming pattern:

$ pug add mac/coda ~/Developer/Coda

To move an existing project into a group, just rename it:

$ pug rename ansible sysops/ansible

Much better:

$ pug show
* bots/mlib
* bots/zoo
* dotfiles
* ios/coda
* ios/transmit
* mac/coda
* mac/transmit
* sysops/ansible
* web/tapas

In addition to keeping projects organized, we can also perform operations on groups just like individual projects. Done with ios for a while? Disable all the projects in that group:

$ pug disable ios

Want to update just the projects in your bots group? Simple!

$ pug update bots

šŸ’” Tip ā€”Ā Add --all to update disabled projects in the group as well


It's important for you to know what Pug is doing on your behalf during pug update. In order of operations:

git pull
git submodule update --init --recursive

If the pug.update.rebase configuration option is set to true, Pug will instead run:

git fetch
git rebase
git submodule update --init --recursive

šŸ”¬ Learn more about how to configure pug update to suit your needs

Dependency Managers

If Pug detects CocoaPods, it will try to determine if an update is necessary. If so:

pod install

If Pug detects Composer and determines an update is necessary:

composer update

To force dependency updates:

$ pug update <target> --force

Submodule State Restoration

šŸŽ‰ New in v0.5

In previous versions, submodules were always left checked out on a detached HEAD after pug update. If you were doing development on a submodule, checking the submodule back out to its original branch and pulling down changes manually was a hassle.

With state restoration, if a submodule is checked out to a branch, Pug now returns it to its previous state and automatically pulls down any changes from the submodule's remote as well:

$ pug update tapas                     
Updating 'tapas'...

 ā€¢ Pulling...
   > From
   >    7b4a17c..e1caf08  master     -> origin/master
   > Updating 339cea5..57c314f
   > Fast-forward
   >  corpora | 2 +-
   >  1 file changed, 1 insertion(+), 1 deletion(-)

 ā€¢ Updating submodules...
   > Submodule path 'corpora': checked out 'e1caf08eac44a149b14e4f2bbc4eb12ba6a4e6e4'
   % Submodule path 'corpora': checked out 'master'
   % Submodule path 'corpora': pulling 'master'... done.

Note ā€”Ā If a submodule is checked out on a detached HEAD prior to the update, pug update leaves it that way.


Pug supports a few configuration options by piggybacking Git's own config command. They can be set either globally (using the --global flag) or on a per-project basis.

For example, we can change the global pug update behavior to always automatically stash changes:

$ git config --global pug.update.stash true

and still keep the default no-stash behavior where we need to:

$ cd ~/Developer/tapas
$ git config pug.update.stash false


āš™ pug.update.rebase

boolean ā€”Ā When true, pug update will perform git fetch and git rebase instead of git pull.

Default value is false

šŸŽ‰ New in v0.5

āš™ pug.update.stash

boolean ā€”Ā When true, automatically stash any changes in the active project before pull-ing, then pop the stack afterward

Default value is false

āš™ pug.update.submodules

boolean ā€”Ā Whether to update submodules during pug update

Default value is true

šŸ’” Tips

Save the "date"

Save yourself a few keystrokes every update:

$ pug up


Command-specific help is always available on the command line:

$ pug help
usage: pug [--version] <command> [<args>]

Commands are:
   add        Start tracking a new project
   disable    Exclude projects from 'all' updates
   enable     Include projects in 'all' updates
   install    Symlink 'pug' to a convenient path
   rename     Rename an existing project
   rm         Stop tracking projects
   show       Show tracked projects
   update     Fetch project updates
   upgrade    Fetch the newest version of Pug

See 'pug help <command>' to read about a specific command


šŸ¶ Update local projects and their dependencies with a single command






No packages published