From: Aristotle Pagaltzis Date: Thu, 25 Mar 2010 03:12:36 +0000 (-0400) Subject: give two simpler recipes for creating remote branches X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b16add97894081f7bc33c611a199d895830161d1;p=p5sagit%2Fp5-mst-13.2.git give two simpler recipes for creating remote branches --- diff --git a/pod/perlrepository.pod b/pod/perlrepository.pod index 25bfaa2..9b0292b 100644 --- a/pod/perlrepository.pod +++ b/pod/perlrepository.pod @@ -774,21 +774,19 @@ Individual committers should create topic branches under B/B. Other committers should check with a topic branch's creator before making any change to it. -A remote topic branch can be created as follows. First, create and -checkout a local branch. Do some work on it, then when you're ready, push -the local branch to the remote repository and update the local branch -to make it track. - - $ branch="$user/$topic" - $ git checkout -b $branch - ... do local edits, commits etc ... - $ git push origin $branch:refs/heads/$branch - $ git config branch.$branch.remote origin - $ git config branch.$branch.merge refs/heads/$branch - -Note that there are many ways to create remote branches, this is just one -relatively straightforward way that should work with most git versions and -configurations. +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: + + $ branch="$yourname/$some_descriptive_name" + $ git checkout -b $branch + $ git push origin -u $branch If you are not the creator of B/B, you might sometimes find that the original author has edited the branch's