How to set up a code review using Gitlab?

前端 未结 5 1786
南方客
南方客 2021-01-30 15:53

How does one set up a code review using Gitlab? I see it listed as a feature on the Gitlab website, but I can\'t seem to find instructions on how to set one up (For that matter

5条回答
  •  一向
    一向 (楼主)
    2021-01-30 16:23

    The normal use-case of code reviews is to review code on a branch before merging into master or similar. I have a situation where I've developed a project and want all the code to be reviewed by everyone on the team.

    What I did was:

    Checkout the first commit, make a change to it, commit and push

    git co -b FIRST_COMMIT eb67f06c2b3222c0219214b176c41922bc454881
    vi README.md
    git add README.md
    git ci -m "First commit modified so can get full diff against it"
    git push --set-upstream origin FIRST-COMMIT
    

    Checkout the last commit, make a change to it, commit and push

    git co -b master
    vi README.md
    git add README.md
    git ci -m "Last commit modified so can get full diff against it"
    git push --set-upstream origin LAST-COMMIT
    

    On GitLab / GitHub, create a pull request

    • It is one merging from LAST_COMMIT to FIRST_COMMIT

    Works for me!

提交回复
热议问题