def branches(self, ctx, args='default'):
"""Lists branches."""
try:
from git import Repo
repo = Repo(os.path.join(os.getcwd(), ".git"))
remotes = repo.remotes[0].refs
for item in remotes:
await ctx.author.send(item.remote_head)
except Exception as e:
await ctx.author.send("```py\nError listing git branches\n```")
raise commands.UserInputError(ctx)
评论列表
文章目录