A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/exussum12/coverageChecker/wiki/Generating-a-diff below:

Generating a diff · exussum12/coverageChecker Wiki · GitHub

The generation of a diff can be done in multiple ways.

The way which works in most places (CI server and locally with non committed changed)

git diff $(git merge-base origin/master HEAD) > /tmp/diff.txt

This shows the all differences from the point the branch diverged with origin/master This is the safest version to use for both uncommitted changed (for example a pre commit hook) and in the CI server (finding the difference for the checked in code)

git diff options also work here such as ignoring whitespace however this is not recommended due to some of the checks failing on whitespace (eg PSR-2)

git diff origin/master... > /tmp/diff.txt

The above command is similar to the first, but will only check the committed differences and not the local ones. This syntax is much nicer but will only work on a CI server or a pre push hook. A branch name can be put after the three dots if you wish to generate a diff for a branch you are not currently on.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4