If you just fetch the remote, then you will find (after a bit of mental
gymnastics) that the branch upstream/gh-pages is already directly
available (locally) as part of the remote refs. However the problem is
how to start a personal, 'editable/extendable' branch for your work on
top of it.
I am guessing that you already have a personal refs/heads/gh-pages that
is mapped to your origin/gh-pages, which you do not want confused.
You probably also want to avoid the confusion of creating a local branch
upstream/gh-pages to be confused with the refs/remote/upstream/gh-pages.
Why not try creating a branch called say, up/gh-pages, (i.e. we shorted
the name to 'up') which can then gain a ref-spec that maps the
refs/heads/up/gh-pages to the refs/remote/upstream/gh-pages when pushing
IF that is want you want to do (assumes you are allowed to push there).
BUT more likely you simply want a refs/remote/origin/up/gh-pages on your
origin and create a PR from there to request the up/gh-pages commits are
accepted at upstream/gh-pages
The trick I used here is to have that extra short name prefix part 'up/'
to disambiguate your two variations of 'gh-pages'.
For further mental gymnastics, remember that, for a branch ref name, the
'/' isn't really a directory separator because refs are a single string.
In fact it is just the internal implementation that sneaks in the trick
of pretending that it's a path so that it can use the FS to create an
fancy internal hierarchy... <heads/explode>
TL;DR add 'up/' prefix to [your copy of] their gh-pages branch, create
refspec to map between it and upstream/gh-pages.
On 20/11/2018 21:37, Michael wrote:
This should be really basic. But up until now, I've never had to rename
branches; when I clone something, or fetch, I fetch all the tags/branch names,
and my stuff is always on a new branch.
Well, I'm now in the case of needing to maintain a branch named "gh-pages", that is not
the same as the "gh-pages" branch of my upstream. And renaming isn't an option.
So, what's the syntax for dealing with (for example)
keybounceMBP:AutoTrimps michael$ git remote -v
origin https://github.com/keybounce/AutoTrimps (fetch)
origin https://github.com/keybounce/AutoTrimps (push)
upstream https://github.com/Zorn192/AutoTrimps (fetch)
upstream https://github.com/Zorn192/AutoTrimps (push)
keybounceMBP:AutoTrimps michael$ git branch --list -a -r
origin/HEAD -> origin/gh-pages
I'm going to want to work with their gh-pages, which is going to be updated, and merged
in, but I want "gh-pages" to be mine. So what do I need to do to keep this
Entertaining minecraft videos
You received this message because you are subscribed to the Google Groups "Git for
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.