I use git for my personal projects, so I have never run into any issues with Git, however I had a discussion at work today and its something that I haven’t thought about.
In TFS you can store your changeset into a shelveset, this shelveset can be viewed by other developers, say for a peer review.
From what I understand in github you are working on your local copy of the repo (possibly with custom branches for different features) and then comes a point for a peer review. How would you go about sharing a specific changes on your local repo with someone else?
0
In Git, the basic model for pre-commit code review is to have a branch somewhere where it can bee reviewed, then merged with the main stream. This branch may be in the same repository as the main stream or in a completely separate one.
Some ways that I’ve seen done are:
- Push a branch to origin, and have the reviewers merge the changeset in when they’re ready.
- Push a branch to a review repository or directly to the reviewer. Once reviewed the changeset may be pushed to the main repository.
- Use a tool like Gerrit to “catch” pushes and hold them until they’re reviewed. Once the right people have confirmed the changeset is ready, Gerrit will merge it into the main branch.
- Using Github, Gitlab, Stash or another product, fork the original repository. Clone to your development machine and perform your changes. When finished, push to your fork and send a pull request to the original repository. This is the most common model in the open source world.
1
Some options:
- You could run an instance of gitweb to allow others to view your changes
- You could distribute patch sets of your changes for review
- You could push your changes to a shared central repo, in your own remote branch, where others can inspect your changes directly or in github.