How do I prevent static or auto-generated files from being displayed in diff on GitHub during a Pull request?

Asked 1 years ago, Updated 1 years ago, 51 views

When I create a Pull request on GitHub and have other members review the code, is there a way to prevent static or auto-generated files from being displayed?

If an external paid CSS template is introduced, a large amount of CSS, JS, images, etc. may be included in the pull request.
These files do not need to be code-reviewed unless there is a special reason.
It's more important to focus on reviewing your own code.

However, if you create a pull request normally, it will be very inefficient for third parties to see that all the code you wrote and files you brought from outside are included in the diff of the pull request.
Also, if there are too many, GitHub may raise the white flag.(See image below)

Example GitHub raises white flag

To avoid these problems, please let me know if you have any workarounds, such as ignoring certain directories (on diff) or making them separate pull requests.

Thank you for your cooperation.

git github

2022-09-30 16:13

4 Answers

It may be a bit complicated, but commit Pull request

How about providing the reviewer with the Pull request number and the link to the commit of 2. in multiple stages of ?
(I remember seeing a blog or Qiita article like this, but I don't know where it is...)


2022-09-30 16:13

When I made a PullRequest on GitHub, I separated branch(A) which only commits static files that I don't want to make a difference from branch(A) which commits the code I want to review, and designated base as A and compare as B.

The specific steps are as follows.
Assume you are operating on the git-flow model.

When merging into development, you should be aware of the following:
You must merge feature/B into feature/A and then merge feature/A into develop.

Personally, I think it's a best practice for now to solve the problem of a large amount of diff and the review operation on GitHub is not working well.


2022-09-30 16:13

I haven't actually tried it with a just idea, but the following steps might work.

If you have any concerns, please let me know.


2022-09-30 16:13

Why is there so little information about githublinguist in Japanese?

So I wrote an article.Perhaps the questioner can do what he wants to do.

Hide diffs such as auto-generated files in PullRequest in Github - Qiita


2022-09-30 16:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.