2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								# How to Create and Maintain a Tap
  
						 
					
						
							
								
									
										
										
										
											2017-01-04 16:16:00 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 13:27:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								[Taps ](Taps.md ) are external sources of Homebrew formulae, casks  and/or external commands. They
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								can be created by anyone to provide their own formulae, casks  and/or external commands
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								to any Homebrew user.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## Creating a tap
  
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 17:45:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								A tap is usually a Git repository available online, but you can use anything as
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								long as it’ 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								files in it.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								If hosted on GitHub, we recommend that the repository’ 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								`homebrew-`  so the short `brew tap`  command can be used. 
						 
					
						
							
								
									
										
										
										
											2018-10-24 09:12:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								See the [manpage ](Manpage.md ) for more information on repository naming.
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-10 11:22:41 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								The `brew tap-new`  command can be used to create a new tap along with some
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								template files.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								Tap formulae follow the same format as the core’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								repository’ `Formula`  or `HomebrewFormula`  subdirectories. We
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								recommend the latter options because it makes the repository organisation
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								easier to grasp, and top-level files are not mixed with formulae.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-31 13:42:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								See [homebrew/core ](https://github.com/Homebrew/homebrew-core ) for an example of
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								a tap with a `Formula`  subdirectory.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Naming your formulae to avoid clashes
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-27 16:11:02 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								If your formulae have the same name as Homebrew/homebrew-core formulae they cannot be installed side-by-side. If you wish to create a different version of a formula that's in Homebrew/homebrew-core (e.g. with `option` s) consider giving it a different name e.g. `nginx-full`  for more fully-featured `nginx`  formula. This will allow both `nginx`  and `nginx-full`  to be installed at the same time (but not linked if there are conflicts and one of them is not declared to be `keg_only` ).
							 
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								### Installing
  
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								If it’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								`brew install user/repo/formula` . Homebrew will automatically add your 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								`github.com/user/homebrew-repo`  tap before installing the formula. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								`user/repo/formula`  points to the `github.com/user/homebrew-repo/**/formula.rb`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								file here.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								If they want to get your tap without installing any formula at the same time,
							 
						 
					
						
							
								
									
										
										
										
											2018-02-23 19:39:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								users can add it with the [`brew tap` command ](Taps.md ).
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								If it’ `brew tap user/repo` , where `user`  is your
							 
						 
					
						
							
								
									
										
										
										
											2019-10-10 18:17:06 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								GitHub username and `homebrew-repo`  is your repository.
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								If it’ `brew tap user/repo <URL>` ,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								where `user`  and `repo`  will be used to refer to your tap and `<URL>`  is your
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Git clone URL.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								Users can then install your formulae either with `brew install foo`  if there’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								no core formula with the same name, or with `brew install user/repo/foo`  to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								avoid conflicts.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## Maintaining a tap
  
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 17:45:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								A tap is just a Git repository so you don’ 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-17 22:53:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								making modifications,  
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								### Updating
  
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-17 00:19:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Once your tap is installed, Homebrew will update it each time a user runs
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								`brew update` . Outdated formulae will be upgraded when a user runs 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								`brew upgrade` , like core formulae. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-10-05 13:27:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Casks
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Casks can also be installed from a tap.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Casks can be included in taps with formulae, or in a tap with just casks.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Place any cask files you wish to make available in a `Casks`  directory at the top level of your tap.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								See [homebrew/cask ](https://github.com/Homebrew/homebrew-cask ) for an example of a tap with a `Casks`  subdirectory.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								### Naming
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Unlike formulae, casks must have globally unique names to avoid clashes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								This can be achieved by e.g. prepending the cask name with you github username: `username-formula-name` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## External commands
  
						 
					
						
							
								
									
										
										
										
											2019-01-26 19:08:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								You can provide your tap users with custom `brew`  commands by adding them in a
							 
						 
					
						
							
								
									
										
										
										
											2018-02-23 19:39:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								`cmd`  subdirectory. [Read more on external commands ](External-Commands.md ). 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 04:31:13 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								See [homebrew/aliases ](https://github.com/Homebrew/homebrew-aliases ) for an
							 
						 
					
						
							
								
									
										
										
										
											2015-07-18 14:07:13 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								example of a tap with external commands.