简体   繁体   中英

Workflow using git pull requests on self hosted git repo

I am trying to understand what a process that uses pull requests on a self-hosted git repo would look like (if it is even possible).

Say I have two branches, feature and master . A bunch of work is completed on the feature branch, and I want to submit a pull request for the changes to be reviewed before being merged into the master branch. As far as I understand it, the steps would be something like:

git push feature (developer pushes commits on feature branch to remote repo)

git request-pull <start commit> feature <end commit> developer creates the pull request. But I'm not entirely sure whether <url> should refer to master or feature branch?

Reviewer would then retrieve the pull request somehow, and if they are happy with it then they would merge the feature branch into master with git merge feature

Is such a workflow possible with self-hosted git? I haven't really used the likes of Github but I know they have a lot of GUI features to manage this sort of thing.

Summary of questions:

  • what should <url> be in the git request-pull command?
  • how does a reviewer receive the pull request?
  • is there a way to view a history of pull requests?
  • is there a way to have someone specific review the pull request?

As far as I understand it, the steps would be something like:

git push feature (developer pushes commits on feature branch to remote repo)

git request-pull <start commit> feature <url> <end commit> developer creates the pull request.

Reviewer would then retrieve the pull request somehow, and if they are happy with it then they would merge the feature branch into master with git merge feature

These are exactly the steps for the pull request workflow.

The git request-pull command simply prints a nicely formatted summary of the changes from <start commit> to <end commit> which you can then send to a reviewer (for example, by email) to notify them. It doesn't send anything on its own.

You would insert the URL of your hosted Git repository as <url> so that the reviewer knows where they could find your commits. <start commit> would be the last commit before those which make up your changes. <end commit> would be the latest commit, ie feature .

You can experiment with the command locally by inserting . as <url> (ie the directory you're in).


Summary of questions:

  • what should <url> be in the git request-pull command?

The URL of your hosted repository (can be a local directory name). (It can be anything, the command will only warn you if there is no repository containing the mentioned commits at that location.)

  • how does a reviewer receive the pull request?

By sending them the output of the command.

  • is there a way to view a history of pull requests?

Not with git request-pull , you have to keep track of them yourself.

  • is there a way to have someone specific review the pull request?

By sending the output of git request-pull to them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM