Github - 拉取请求,忽略一些文件更改 [英] Github - Pull Request, ignore some file changes

查看:949
本文介绍了Github - 拉取请求,忽略一些文件更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在GitHub上执行Pull请求时(针对master分支),我们是否可以忽略一些文件更改,如


  • 我们有一个在分支'release'中命名为'fileA',我们在'master'中有相同的文件,但是我们在分支'release'中对'fileA'进行了一些修改

  • 一个合并请求,有什么办法可以忽略'fileA'中的变化,不要让它合并成'master'。

    解决方案

    您不能有选择地忽略拉取请求中的某些文件。
    这可以解决两个问题 -



    第一 -




    • 从'release'创建一个新分支

    • 从'master'替换不需要的文件

    • 从这个新分支创建请求
    • >


    第二个 -




    • master'
    • 将所需文件从'release'更改

    • 从这个新分支创建请求

    • ul>

      这种方法都可以工作。哪个更容易取决于包含/排除多少个文件。


      When I do a Pull Request on GitHub (against master branch), can we ignore some file changes, like

      • we have one file named 'fileA' in branch 'release', and we have the same file in 'master', but we do some changes in 'fileA' in branch 'release'
      • when we do a Pull Request, is there any way we can ignore the changes in 'fileA', do not let that merge into 'master'.

      解决方案

      You can't ignore some files from a pull request selectively. Two workarounds for this can be -

      First -

      • Create a new branch from 'release'
      • Replace the non-required files from 'master'
      • Create pull request from this new branch

      Second -

      • Create a new branch from 'master'
      • Put changes of required files from 'release'
      • Create pull request from this new branch

      Any of this method will work. Which will be easier depends upon how many files are to be included / excluded.

      这篇关于Github - 拉取请求,忽略一些文件更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆