This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlgit: demote old-git remote branch procedure
authorAristotle Pagaltzis <pagaltzis@gmx.de>
Tue, 21 Jul 2015 10:22:40 +0000 (12:22 +0200)
committerAristotle Pagaltzis <pagaltzis@gmx.de>
Tue, 21 Jul 2015 10:22:40 +0000 (12:22 +0200)
pod/perlgit.pod

index b45faf4..7e56ff0 100644 (file)
@@ -477,24 +477,25 @@ binary searches.
 =head2 Topic branches and rewriting history
 
 Individual committers should create topic branches under
-B<yourname>/B<some_descriptive_name>. Other committers should check
-with a topic branch's creator before making any change to it.
-
-The simplest way to create a remote topic branch that works on all
-versions of git is to push the current head as a new branch on the
-remote, then check it out locally:
-
-  $ branch="$yourname/$some_descriptive_name"
-  $ git push origin HEAD:$branch
-  $ git checkout -b $branch origin/$branch
-
-Users of git 1.7 or newer can do it in a more obvious manner:
+B<yourname>/B<some_descriptive_name>:
 
   $ branch="$yourname/$some_descriptive_name"
   $ git checkout -b $branch
+  ... do local edits, commits etc ...
   $ git push origin -u $branch
 
-If you are not the creator of B<yourname>/B<some_descriptive_name>, you
+Should you be stuck with an ancient version of git (prior to 1.7), then
+C<git push> will not have the C<-u> switch, and you have to replace the
+last step with the following sequence:
+
+  $ git push origin $branch:refs/heads/$branch
+  $ git config branch.$branch.remote origin
+  $ git config branch.$branch.merge refs/heads/$branch
+
+If you want to make changes to someone else's topic branch, you should
+check with its creator before making any change to it.
+
+You
 might sometimes find that the original author has edited the branch's
 history. There are lots of good reasons for this. Sometimes, an author
 might simply be rebasing the branch onto a newer source point.