git_integration.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:fermentrack 作者: thorrak 项目源码 文件源码
def get_remote_branch_info():
    local_repo = Repo(path=settings.BASE_DIR)

    # Fetch remote branches to ensure we are up to date
    for remote in local_repo.remotes:
        remote.fetch()

    remote_repo = local_repo.remote()

    local_branch = local_repo.active_branch.name
    remote_branches = []

    for this_branch in remote_repo.refs:
        remote_branches.append(this_branch.remote_head)

    return {'local_branch': local_branch, 'remote_branches': remote_branches}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号