diff options
| author | Max Howell | 2011-09-20 02:25:50 +0100 |
|---|---|---|
| committer | Max Howell | 2011-09-20 02:30:31 +0100 |
| commit | e26797f471a466577e8415d19c8867e71f379269 (patch) | |
| tree | ef80f62fdceb8d64cb6d6a481de67486e68b77df /Library | |
| parent | 2be915db9972ca079ca2904a98640134297c42ae (diff) | |
| download | brew-e26797f471a466577e8415d19c8867e71f379269.tar.bz2 | |
Allow `brew update --rebase`
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/manpages/brew.1.md | 7 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/update.rb | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index 5fc03ace8..1cc524472 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -231,8 +231,11 @@ For the full command list, see the COMMANDS section. Unsymlink <formula> from the Homebrew prefix. This can be useful for temporarily disabling a formula: `brew unlink foo && commands && brew link foo`. - * `update`: - Fetch the newest version of Homebrew from GitHub using `git`(1). + * `update [--rebase]`: + Fetch the newest version of Homebrew and all formulae from GitHub using + `git`(1). + + If --rebase is specified then `git pull --rebase` is used. * `upgrade` [<formulae>]: Upgrade outdated brews. diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb index 773bf257d..1073ef1f0 100644 --- a/Library/Homebrew/cmd/update.rb +++ b/Library/Homebrew/cmd/update.rb @@ -49,8 +49,11 @@ class RefreshBrew raise end end + # specify a refspec so that 'origin/master' gets updated - execute "git pull origin refs/heads/master:refs/remotes/origin/master" + refspec = "refs/heads/master:refs/remotes/origin/master" + rebase = "--rebase" if ARGV.include? "--rebase" + execute "git pull #{rebase} origin #{refspec}" @current_revision = read_revision end |
