git 拉取 pr 分支的方法

admin 阅读:136 2024-03-02

在本地仓库的 .git 目录(可能是隐藏的)的 config 文件中,添加fetch = +refs/pull/*/head:refs/remotes/origin/pr/*,完成后的代码大致如下:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:joyent/node.git
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

然后再拉取即可。

声明

1、部分文章来源于网络,仅作为参考。
2、如果网站中图片和文字侵犯了您的版权,请联系1943759704@qq.com处理!