Skip to content

Commit

Permalink
scm: add git pull/push to Git
Browse files Browse the repository at this point in the history
  • Loading branch information
Suor committed Jan 30, 2020
1 parent b4b5781 commit f8c4001
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dvc/scm/git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,15 @@ def checkout(self, branch, create_new=False):
else:
self.repo.git.checkout(branch)

def pull(self):
info, = self.repo.remote().pull()
if info.flags & info.ERROR:
raise SCMError("pull failed: {}".format(info.note))

def push(self):
self.repo.remote().push()
info, = self.repo.remote().push()
if info.flags & info.ERROR:
raise SCMError("push failed: {}".format(info.summary))

def branch(self, branch):
self.repo.git.branch(branch)
Expand Down

0 comments on commit f8c4001

Please sign in to comment.