diff --git a/src/centpkg/__init__.py b/src/centpkg/__init__.py
index 588fc23..e311c9a 100644
--- a/src/centpkg/__init__.py
+++ b/src/centpkg/__init__.py
@@ -43,7 +43,8 @@ class DistGitDirectory(object):
 
     def __init__(self, branchtext, repo_path=None):
         if repo_path:
-            self.repo = git.cmd.Git(repo_path)
+            # self.repo = git.cmd.Git(repo_path)
+            self.repo = git.repo.Repo(repo_path)
         sigtobranchre = r'c(?P<centosversion>\d+[s]?)-sig-(?P<signame>\w+)-?(?P<projectname>\w+)?-?(?P<releasename>\w+)?'
         distrobranchre = r'c(?P<centosversion>\d+)-?(?P<projectname>\w+)?'
         oldbranchre = r'(?P<signame>\w+)(?P<centosversion>\d)'
@@ -86,7 +87,12 @@ class DistGitDirectory(object):
     def get_origin(self):
         if self.repo is None:
             return ''
-        return self.repo.execute('git config --get remote.origin.url'.split())
+        if 'origin' not in self.repo.remotes:
+            return ''
+        urls = [u for u in self.repo.remotes['origin'].urls]
+        if len(urls) == 0:
+            return ''
+        return urls[0]
 
     def is_fork(self):
         """
diff --git a/tests/test_distgit.py b/tests/test_distgit.py
index 5b1ad05..96142ff 100644
--- a/tests/test_distgit.py
+++ b/tests/test_distgit.py
@@ -1,6 +1,8 @@
 import unittest
 import unittest.mock
 
+import git
+
 from .mixins import CatchWarningsMixin
 from centpkg import DistGitDirectory
 from centpkg import git as centpkg_git
@@ -192,12 +194,14 @@ class TestIsFork(unittest.TestCase):
         d = DistGitDirectory(self.branchstring)
         self.assertFalse(d.is_fork())
 
-    @unittest.mock.patch.object(centpkg_git.cmd.Git, 'execute', new=lambda s, c: 'git@gitlab.com:user/centos_rpms_binutils.git')
+    @unittest.mock.patch.object(centpkg_git.repo.Repo, 'remotes', new=dict(origin=type('Remote', (object,), {'urls': ['ssh://git@git.centos.org/forks/lrossett/centos/centpkg.git']})))
+    @unittest.mock.patch.object(centpkg_git.repo.Repo, '__init__', new=lambda s, p: None)
     def test_fork_url(self):
         d = DistGitDirectory(self.branchstring, 'binutils')
         self.assertTrue(d.is_fork())
-
-    @unittest.mock.patch.object(centpkg_git.cmd.Git, 'execute', new=lambda s, c: 'git+ssh://git@gitlab.com/redhat/centos-stream/rpms/binutils.git')
+    
+    @unittest.mock.patch.object(centpkg_git.repo.Repo, 'remotes', new=dict(origin=type('Remote', (object,), {'urls': ['git+ssh://git@gitlab.com/redhat/centos-stream/rpms/binutils.git']})))
+    @unittest.mock.patch.object(centpkg_git.repo.Repo, '__init__', new=lambda s, p: None)
     def test_upstream_url(self):
         d = DistGitDirectory(self.branchstring, 'binutils')
         self.assertFalse(d.is_fork())
\ No newline at end of file