9

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?

12

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:

  1. Push a branch to origin, and have the reviewers merge the changeset in when they're ready.
  2. Push a branch to a review repository or directly to the reviewer. Once reviewed the changeset may be pushed to the main repository.
  3. 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.
  4. 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.
  • 0. Visual Studio Online has a Pull-request feature that will be available in a near future version of TFS on-premises. – Giulio Vian Sep 16 '14 at 11:03
0

Some options:

  1. You could run an instance of gitweb to allow others to view your changes
  2. You could distribute patch sets of your changes for review
  3. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.