From: Pete Wyckoff <pw@padd.com>
To: git@vger.kernel.org
Subject: branch tracking: inherit upstream
Date: Fri, 15 Jul 2011 07:09:28 -0400 [thread overview]
Message-ID: <20110715110928.GA3425@arf.padd.com> (raw)
At work, our primary SCM is perforce (p4), but many of us use git
in front of that for day-to-day work. The build system requires
information about what part of the P4 repository it is building.
I've cobbled together changes to make this work with git, and
have been using "git merge-base HEAD @{upstream}" to find the
top-most git-p4 commit.
But @{upstream} is not automatically inherited by branches. It
is fine when a local branch is a normal tracking branch of
origin/master, like:
$ git checkout master
$ git rev-parse --symbolic-full-name @{upstream}
refs/remotes/origin/master
But I'd also like this to work:
$ git branch feature
$ git checkout feature
$ git rev-parse --symbolic-full-name @{upstream}
error: No upstream branch found for ''
@{upstream}
error: No upstream branch found for ''
fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
I know I can do:
$ git branch --set-upstream feature origin/master
but that is a pain. And I know I can track the local master, but
that is not what I want.
I'm looking for something like "branch.autosetupupstream" that
would cause the upstream of new branches to be copied from the
old branch (when it exists). Does this make sense?
-- Pete
next reply other threads:[~2011-07-15 11:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 11:09 Pete Wyckoff [this message]
2011-07-15 15:51 ` branch tracking: inherit upstream Jay Soffian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110715110928.GA3425@arf.padd.com \
--to=pw@padd.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.