简体   繁体   中英

git request-pull from local branch to remote master

I really love the github pull-request method for collaboration on distributed software development. It allows discussion and code review.

My goal is to use the same flow but inside our repository without github. I don't want to fork the project.

Lets imagine, I develop an awesome feature locally. And I want to make a pull request on my master branch to force code review.

  A---B---C feature/awesomeFeature
 /
D---E---F---G origin/master
              master

is it possible to make a pull request on origin/master ?

I tried git request-pull feature/awesomeFeature origin without any success

If you developed your feature branch locally, you just have to use:

git request-pull origin/master feature/awesomeFeature

This will only give you a summary of the changes. If you want every detail, remember to add -p (for patch) to your command line.

Pull requests aren't actually implemented within git itself, so you will need another system to sit on top of git. If you want to host your repository yourself, you can use software such as GitLab to manage your repo and allow you to make pull requests.

is it possible to make a pull request on origin/master ?

As long as origin/master is a valid branch, yes.

But with Git 2.23 (Q3 2019) " git request-pull " learned to warn when the ref we ask them to pull from in the local repository and in the published repository are different.

See commit 0454220 , commit 5731dfc (28 May 2019) by Paolo Bonzini ( bonzini ) .
(Merged by Junio C Hamano -- gitster -- in commit dedc046 , 17 Jun 2019)

request-pull : warn if the remote object is not the same as the local one

In some cases, git request-pull might be invoked with remote and local objects that differ even though they point to the same commit.
For example, the remote object might be a lightweight tag vs. an annotated tag on the local side; or the user might have reworded the tag locally and forgotten to push it.

When this happens git-request-pull will not warn, because it only checks that " git ls-remote " returns an SHA1 that matches the local commit (known as $headrev in the script).

This patch makes git-request-pull retrieve the tag object SHA1 while processing the " git ls-remote " output, so that it can be matched against the local object.

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