Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
643 views
in Technique[技术] by (71.8m points)

git - Pull Request, ignore some file changes

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'.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...