---
title: "github pullrequest 简单流程"
author: "ipython"
date: "2019-06-26T22:16:01Z"
tags: []
categories: ["互联网"]
slug: "github-pullrequest"
draft: false
lastmod: "2019-06-26T22:16:01Z"
id: 2442189
url: "https://ipython.iteye.com/blog/2442189"
---

git pull request 流程

有远程项目X,先将X fork 到自己的项目A

git clone A

git checkout -b fix\_xxx  // 建立新分支来处理问题

git commit -am "xxx"     // 提交

git push origin fix\_xxx  // 推送到线上的A, 根据提示在github的页面上发pull request

这时，原来的X会更新，需要将更新拉下来

git remote add upstream https://github.com/X

git remote set-url --push upstream no\_push

git remote -v    // 检查， A是fetch和push，  X只是fetch

git checkout master

git fetch upstream

git rebase upstream/master

 

git checkout fix\_xxx   

git merge master

git push origin fix\_xxx