Skip to content

Commit a80e1bb

Browse files
Adding git pull examples
1 parent cd92323 commit a80e1bb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/git/base.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,13 @@ def each_conflict(&block) # :yields: file, your_version, their_version
331331
self.lib.conflicts(&block)
332332
end
333333

334-
# fetches a branch from a remote and merges it into the current working branch
335-
def pull(remote = 'origin', branch = 'master')
334+
# pulls the given branch from the given remote into the current branch
335+
#
336+
# @git.pull # pulls from origin/master
337+
# @git.pull('upstream') # pulls from upstream/master
338+
# @git.pull('upstream', 'develope') # pulls from upstream/develop
339+
#
340+
def pull(remote='origin', branch='master')
336341
self.lib.pull(remote, branch)
337342
end
338343

lib/git/lib.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def push(remote, branch = 'master', tags = false)
544544
command('push', ['--tags', remote]) if tags
545545
end
546546

547-
def pull(remote = 'origin', branch = 'master')
547+
def pull(remote='origin', branch='master')
548548
command('pull', [remote, branch])
549549
end
550550

0 commit comments

Comments
 (0)