Background:
The GitHub belongs to the client. We have some newbies in the team, who sometimes miss basic naming convention and other coding protocols. So, if any senior wants to review internally there is no other way but to create a PR. But then this PR is visible to the client too.
Question: Is it possible we use a tool (better if GitHub has a feature) to review internally and then create a clean nice PR?
I understand PR itself means it is for review purposes, but at least after internal reviews, it would have genuine issues to look into not some trivial/obvious issues.
You could have a newbies branch (let's call it
dev1
) that is never pushed to the remote (GitHub) and a development branch (let's call itdev2
) that is pushed to create PRs.Junior developers would write to
dev1
.Instead of using PRs in the review process, senior developers would compare
dev1
anddev2
before mergingdev1
intodev2
.Calling them
dev1
anddev2
(or similar) creates a 2 step process and does not make anyone feel that they are treated as kids.If you don't want all the messy commits along
dev1
to show in the history that will ultimately be merged intodev2
(and pushed to GitHub), once you are happy with whatdev1
looks like, you can use a "git reset squashing": the "Squashing" paragraph near the end of this page in the Git book gives a great example.This is how this goes:
First you move HEAD back to the last commit you are happy with (presumably the last common commit between
dev1
anddev2
):Then you run:
That way you jump straight back to the final point you were happy with on
dev1
from that last common commit betweendev1
anddev2
, "squashing" all those intermediate messy commits.In this workflow, you can have a side by side comparison while you review
dev1
(by diffing it againstdev2
), you hide all the mishaps that have happened during its development (you mergedev1
intodev2
only after you have created a nice clean history withgit reset
) and then you pushdev2
to GitHub to create a PR.At the end of the process, your client only sees the clean version with genuine issues and only has to review what matters.
Of course, this necessitates everyone in your team to have access to the project independently of GitHub (for instance, through an internal remote on a server or similar). So this option may not be practical in your particular setting.
If an internal remote is not practical, you can implement a similar workflow through a private clone on GitHub, as @choroba suggested.
Either way, the key elements are: