mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Update Taps.md
This commit is contained in:
parent
f1b3d6ec4c
commit
66830f9d17
51
docs/Taps.md
51
docs/Taps.md
@ -1,37 +1,39 @@
|
|||||||
# Taps (Third-Party Repositories)
|
# Taps (Third-Party Repositories)
|
||||||
|
|
||||||
`brew tap` adds more repositories to the list of formulae that `brew` tracks, updates,
|
The `brew tap` command adds more repositories to the list of formulae that Homebrew tracks, updates,
|
||||||
and installs from. By default, `tap` assumes that the repositories come from GitHub,
|
and installs from. By default, `tap` assumes that the repositories come from GitHub,
|
||||||
but the command isn't limited to any one location.
|
but the command isn't limited to any one location.
|
||||||
|
|
||||||
## The `brew tap` command
|
## The `brew tap` command
|
||||||
|
|
||||||
* `brew tap` without arguments lists the currently tapped repositories. For
|
* `brew tap` without arguments lists all currently tapped repositories. For
|
||||||
example:
|
example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ brew tap
|
$ brew tap
|
||||||
|
homebrew/cask
|
||||||
homebrew/core
|
homebrew/core
|
||||||
mistydemeo/tigerbrew
|
petere/postgresql
|
||||||
dunn/emacs
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- vale Homebrew.Terms = OFF -->
|
<!-- vale Homebrew.Terms = OFF -->
|
||||||
<!-- The `terms` lint suggests changing "repo" to "repository". But we need the abbreviation in the tap syntax and URL example. -->
|
<!-- The `terms` lint suggests changing "repo" to "repository". But we need the abbreviation in the tap syntax and URL example. -->
|
||||||
|
|
||||||
* `brew tap <user/repo>` makes a clone of the repository at
|
* `brew tap <user/repo>` makes a clone of the repository at
|
||||||
https://github.com/user/homebrew-repo. After that, `brew` will be able to work on
|
_https://github.com/\<user>/homebrew-\<repo>_ into `$(brew --repository)/Library/Taps`.
|
||||||
those formulae as if they were in Homebrew's canonical repository. You can
|
After that, `brew` will be able to work with those formulae as if they were in Homebrew's
|
||||||
install and uninstall them with `brew [un]install`, and the formulae are
|
[homebrew/core](https://github.com/Homebrew/homebrew-core) canonical repository.
|
||||||
|
You can install and uninstall them with `brew [un]install`, and the formulae are
|
||||||
automatically updated when you run `brew update`. (See below for details
|
automatically updated when you run `brew update`. (See below for details
|
||||||
about how `brew tap` handles the names of repositories.)
|
about how `brew tap` handles the names of repositories.)
|
||||||
|
|
||||||
<!-- vale Homebrew.Terms = ON -->
|
<!-- vale Homebrew.Terms = ON -->
|
||||||
|
|
||||||
* `brew tap <user/repo> <URL>` makes a clone of the repository at URL.
|
* `brew tap <user/repo> <URL>` makes a clone of the repository at _URL_.
|
||||||
Unlike the one-argument version, URL is not assumed to be GitHub, and it
|
Unlike the one-argument version, _URL_ is not assumed to be GitHub, and it
|
||||||
doesn't have to be HTTP. Any location and any protocol that Git can handle is
|
doesn't have to be HTTP. Any location and any protocol that Git can handle is
|
||||||
fine.
|
fine, although non-GitHub taps require running `brew tap --force-auto-update <user/repo>`
|
||||||
|
to enable automatic updating.
|
||||||
|
|
||||||
* `brew tap --repair` migrates tapped formulae from a symlink-based to
|
* `brew tap --repair` migrates tapped formulae from a symlink-based to
|
||||||
directory-based structure. (This should only need to be run once.)
|
directory-based structure. (This should only need to be run once.)
|
||||||
@ -42,25 +44,24 @@ but the command isn't limited to any one location.
|
|||||||
|
|
||||||
## Repository naming conventions and assumptions
|
## Repository naming conventions and assumptions
|
||||||
|
|
||||||
* On GitHub, your repository must be named `homebrew-something` in order to use
|
On GitHub, your repository must be named `homebrew-something` to use
|
||||||
the one-argument form of `brew tap`. The prefix 'homebrew-' is not optional.
|
the one-argument form of `brew tap`. The prefix "homebrew-" is not optional.
|
||||||
(The two-argument form doesn't have this limitation, but it forces you to
|
(The two-argument form doesn't have this limitation, but it forces you to
|
||||||
give the full URL explicitly.)
|
give the full URL explicitly.)
|
||||||
|
|
||||||
* When you use `brew tap` on the command line, however, you can leave out the
|
When you use `brew tap` on the command line, however, you can leave out the
|
||||||
'homebrew-' prefix in commands.
|
"homebrew-" prefix in commands. That is, `brew tap username/foobar` can be used as a shortcut for the long
|
||||||
|
version: `brew tap username/homebrew-foobar`. `brew` will automatically add
|
||||||
That is, `brew tap username/foobar` can be used as a shortcut for the long
|
back the "homebrew-" prefix whenever it's necessary.
|
||||||
version: `brew tap username/homebrew-foobar`. `brew` will automatically add
|
|
||||||
back the 'homebrew-' prefix whenever it's necessary.
|
|
||||||
|
|
||||||
## Formula with duplicate names
|
## Formula with duplicate names
|
||||||
|
|
||||||
If your tap contains a formula that is also present in
|
If your tap contains a formula that is also present in
|
||||||
[homebrew/core](https://github.com/Homebrew/homebrew-core), that's fine,
|
[homebrew/core](https://github.com/Homebrew/homebrew-core), that's fine,
|
||||||
but it means that you must install it explicitly by default.
|
but you would need to specify its fully qualified name in the form
|
||||||
|
`<user>/<repo>/<formula>` to install your version.
|
||||||
|
|
||||||
Whenever a `brew install foo` command is issued, `brew` will find which formula
|
Whenever a `brew install foo` command is issued, `brew` selects which formula
|
||||||
to use by searching in the following order:
|
to use by searching in the following order:
|
||||||
|
|
||||||
* core formulae
|
* core formulae
|
||||||
@ -69,13 +70,13 @@ to use by searching in the following order:
|
|||||||
If you need a formula to be installed from a particular tap, you can use fully
|
If you need a formula to be installed from a particular tap, you can use fully
|
||||||
qualified names to refer to them.
|
qualified names to refer to them.
|
||||||
|
|
||||||
You can create a tap for an alternative `vim` formula. The behaviour will be:
|
If you were to create a tap for an alternative `vim` formula, the behaviour would be:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
brew install vim # installs from homebrew/core
|
brew install vim # installs from homebrew/core
|
||||||
brew install username/repo/vim # installs from your custom repository
|
brew install username/repo/vim # installs from your custom repository
|
||||||
```
|
```
|
||||||
|
|
||||||
As a result, we recommend you give formulae a different name if you want to make
|
As a result, we recommend you give new names to customized formulae if you want to make
|
||||||
them easier to install. Note that there is (intentionally) no way of replacing
|
them easier to install. Note that there is (intentionally) no way of replacing
|
||||||
dependencies of core formulae with those from taps.
|
dependencies of core formulae with those from other taps.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user