1

I am trying to have code reviews on each commit done since team members are directly connected to a bitbucket repository... I am trying to do this instead of having team members fork the main repository and create pull request while also avoiding the use of branches.

I know it is not a traditional way of doing things, but keeping it simple would be a huge benefit for this team as I have a a few new git users that do not know how to manage their own repository.

Balry
  • 77
  • 10
  • 3
    click on the individual commit hash on that repository and it will open up just those changes. You can add comments to files changed like you can for PRs, as well as add tags. if your team members are new to git, they should learn git basics like forking and branching early on. these operations are integral to day-to-day git usage, and IMHO trying to make things easier this way it will harm their understanding of git, and in the long run your process as well. – Derek Jan 07 '19 at 18:23

1 Answers1

2

I don't think it's possible to have code reviews if all the team members use the same repository and same branch to commit to.

I think the simplest way to achieve this would be to make everyone branch out from a fixed branch (usually dev) and to disallow anyone to commit directly to it. The only way to have their latest changes merged into this branch would be via a pull request which needs to be reviewed.

Calvin Iyer
  • 161
  • 4
  • I've used your answer and enhance it. Our team used to use one branch (master) for develop, and suddenly we wish to review the code made for 6 weeks. What we do: we've created the branch 'to-be-reviewed' from the commit witch was made 6 weeks ago, before our work have been started and merge master to the branch 'to-be-reviewed' with creating merge commit. After that we've pushed the branch to the Bitbucket server and that's allow us to review all the changes in that merge commit – Mikhail V. Aug 12 '21 at 12:51