Skip to content

Commit 13374a0

Browse files
author
TJ Biddle
committed
Add git rebase command.
1 parent fc5e634 commit 13374a0

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

git.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Gem::Specification.new do |s|
77
s.name = %q{git}
8-
s.version = "1.2.12"
8+
s.version = "1.2.13"
99

1010
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
1111
s.authors = ["Scott Chacon"]

lib/git/base.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ def merge(branch, message = 'merge', arr = [])
328328
self.lib.merge(branch, message, arr)
329329
end
330330

331+
def rebase(branch)
332+
self.lib.rebase(branch)
333+
end
334+
331335
# iterates over the files which are unmerged
332336
def each_conflict(&block) # :yields: file, your_version, their_version
333337
self.lib.conflicts(&block)

lib/git/branch.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ def merge(branch = nil, message = nil)
7777
@base.merge(@name)
7878
end
7979
end
80+
81+
def rebase(branch)
82+
@base.rebase(branch)
83+
end
84+
8085

8186
def update_ref(commit)
8287
@base.lib.update_ref(@full, commit)

lib/git/lib.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ def merge(branch, message = nil, arr_opts = [])
514514
command('merge', arr_opts)
515515
end
516516

517+
def rebase(branch)
518+
command('rebase', [branch])
519+
end
520+
517521
def pull(remote = nil, branch = nil)
518522
opts = []
519523
opts << remote if remote

ruby-git.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
spec = Gem::Specification.new do |s|
22
s.platform = Gem::Platform::RUBY
33
s.name = "git"
4-
s.version = "1.1.1"
4+
s.version = "1.1.13"
55
s.author = "Scott Chacon"
66
s.email = "schacon@gmail.com"
77
s.homepage = "http://github.com/schacon/ruby-git/tree/master"

0 commit comments

Comments
 (0)