Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab API commits diff dont get all files

Tags:

git

diff

gitlab

i imported my project from my personal server who runs gitea to gitlab. now i try to write a update function and use the gitlab api. i think it works good but i run the diff function to compare to files and by one commit it contains much files. i call this api function:

https://gitlab.com/api/v4/projects/project:id/repository/commits/commit:id/diff?page=3

on page 1 and 2 it show me all files but after page 2 the api call me it gives no more diffs but i look in my prject commits in gitlab it show me very more files. i think its a api error but i hope anyone have another idea

like image 480
Pla558 Avatar asked Feb 25 '26 17:02

Pla558


1 Answers

in gitlab it show me very more files

Check the nature of the diff shown.
If:

  • the diffs are eol (end of lines) related
  • you have a configuration like true or input for git config core.autocrlf

that would explain the extra diffs.

Try again, but this time cloning your repo after typing first:

git config --global core.autocrlf false
like image 178
VonC Avatar answered Feb 27 '26 06:02

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!