diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/git/base.rb | 6 | ||||
-rw-r--r-- | lib/git/lib.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/git/base.rb b/lib/git/base.rb index d97948e..21578f8 100644 --- a/lib/git/base.rb +++ b/lib/git/base.rb @@ -185,7 +185,7 @@ module Git self.lib.commit(message, opts) end - def checkout(branch, opts = {}) + def checkout(branch = 'master', opts = {}) self.lib.checkout(branch, opts) end @@ -193,6 +193,10 @@ module Git self.lib.fetch(remote) end + def push(remote = 'origin', branch = 'master') + self.lib.push(remote, branch) + end + def merge(branch, message = 'merge') self.lib.merge(branch, message) end diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 5bb2e2b..575f0d7 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -296,6 +296,10 @@ module Git command('fetch', remote.to_s) end + def push(remote, branch = 'master') + command('push', [remote.to_s, branch.to_s]) + end + def tag_sha(tag_name) command('show-ref', ['--tags', '-s', tag_name]) end |