I use Gitlab CI for checking a code quality of my project. Sometime I want to check only new code ( new commit ).
How can I get diff from Gitlab CI ?
You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.
Diffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.
Under the activity tab , there should be a subtab just for 'commits' that lists all commits to the project as they are happening.
git-diff-tree - Compares the content and mode of blobs found via two tree objects.
I found out solution, it was obvious, but not for me
diff:
script:
- git diff ${CI_COMMIT_SHA} master
except:
- master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With