summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2021-02-04 10:17:36 +1100
committerTony Cook <tony@develop-help.com>2021-03-15 11:25:02 +1100
commitf7349d1a0e9b00925d5b641ee557f2c03091e373 (patch)
treef2d9804aeed3ff65e0c18f0702a9e463cb2777de
parent6be38225cd6d37e945589213630041ac4663cba7 (diff)
downloadperl-f7349d1a0e9b00925d5b641ee557f2c03091e373.tar.gz
document how to create a remote-tracking branche for every PR
-rw-r--r--pod/perlgit.pod29
1 files changed, 29 insertions, 0 deletions
diff --git a/pod/perlgit.pod b/pod/perlgit.pod
index f5a6505acd..2c7f5e85e2 100644
--- a/pod/perlgit.pod
+++ b/pod/perlgit.pod
@@ -581,6 +581,35 @@ checkout above, you might want:
which rebases C<local-branch-name> on C<blead>, and checks it out.
+Alternatively you can configure the remote to fetch all pull requests
+as remote-tracking branches. To do this edit the remote in
+F<.git/config>, for example if your github remote is C<origin> you'd
+have:
+
+ [remote "origin"]
+ url = git@github.com:/Perl/perl5.git
+ fetch = +refs/heads/*:refs/remotes/origin/*
+
+Add a line to map the remote pull request branches to remote-tracking
+branches:
+
+ [remote "origin"]
+ url = git@github.com:/Perl/perl5.git
+ fetch = +refs/heads/*:refs/remotes/origin/*
+ fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
+
+and then do a fetch as normal:
+
+ git fetch origin
+
+This will create a remote-tracking branch for every pull request, including
+closed requests.
+
+To remove those remote-tracking branches, remove the line added above
+and prune:
+
+ git fetch -p origin # or git remote prune origin
+
=head2 Accepting a patch
If you have received a patch file generated using the above section,