On Gitlab, how to compare a file of two different

2019-06-26 03:47发布

On Gitlab, how to compare a file of two different commits? I know that that on command line git, the command is:

git diff commit1 commit12 -- file_name

what is the link format to do this on gitlab?

see my related question

标签: git gitlab
2条回答
叛逆
2楼-- · 2019-06-26 03:55

It will compare commits, You will be able to find file in list.

1) go to Repository > Compare
2) paste: https://gitlab.com/$USER/$REPO/compare?from=$SHA1&to=$SHA2 url
3) hit enter (notice: gitlab will set 'Source' and 'Target' properly)
4) click button 'compare'

查看更多
戒情不戒烟
3楼-- · 2019-06-26 04:03

I can compare files within commits by doing the following:

Repository -> Commits

Select the desired Branch and Commit

This results in a side by side comparison of all changes across all files. Just below the commit message is this statement (yours will obviously be differ)

Showing 18 changed files with 209 additions and 68 deletions

The 18 changed files is a dropdown menu with a list of all changed files. Select the file you want to compare. This will reduce the list to just the file of interest.

查看更多
登录 后发表回答