Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the commit diff in Gitlab CI?

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 ?

like image 290
Artem Chernov Avatar asked Jun 04 '18 13:06

Artem Chernov


People also ask

How do you diff commits in git?

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.

What is git diff command?

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.

Where would you go to find a list of commits for a project on GitLab?

Under the activity tab , there should be a subtab just for 'commits' that lists all commits to the project as they are happening.

What is git diff tree?

git-diff-tree - Compares the content and mode of blobs found via two tree objects.


1 Answers

I found out solution, it was obvious, but not for me

 diff:
   script:
     - git diff ${CI_COMMIT_SHA} master
   except:
     - master
like image 166
Artem Chernov Avatar answered Oct 14 '22 06:10

Artem Chernov