Permalink
Browse files

Allow `brew update --rebase`

  • Loading branch information...
1 parent 3353835 commit dec4b73aa0f30fcc2a31fa87e6be5e31ec58cd5f @mxcl mxcl committed Sep 20, 2011
Showing with 14 additions and 5 deletions.
  1. +5 −2 Library/Contributions/manpages/brew.1.md
  2. +4 −1 Library/Homebrew/cmd/update.rb
  3. +5 −2 share/man/man1/brew.1
@@ -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.
@@ -49,8 +49,11 @@ def update_from_masterbrew!
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
View
@@ -256,8 +256,11 @@ Example: \fBbrew install jruby && brew test jruby\fR
Unsymlink \fIformula\fR from the Homebrew prefix\. This can be useful for temporarily disabling a formula: \fBbrew unlink foo && commands && brew link foo\fR\.
.
.TP
-\fBupdate\fR
-Fetch the newest version of Homebrew from GitHub using \fBgit\fR(1)\.
+\fBupdate [\-\-rebase]\fR
+Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1)\.
+.
+.IP
+If \-\-rebase is specified then \fBgit pull \-\-rebase\fR is used\.
.
.TP
\fBupgrade\fR [\fIformulae\fR]

0 comments on commit dec4b73

Please sign in to comment.