<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self, cmd):
 """Execute git command in bash"""

        cmd = ['git', '--git-dir=%s' % self.path] + cmd
        print("cmd list", cmd)
        print("cmd", ' '.join(cmd))
        res = None
        try:
            res = subprocess.check_output(cmd)
        except BaseException:
            pass
        if res:
            try:
                res = res.decode()
            except UnicodeDecodeError:
                res = res.decode('utf-8')
        return res