From: Chris Packham <judge.packham@gmail.com>
To: David Abrahams <dave@boostpro.com>
Cc: git@vger.kernel.org
Subject: Re: Separate default push/pull?
Date: Thu, 11 Feb 2010 13:57:34 -0500 [thread overview]
Message-ID: <a038bef51002111057l382ed55fy6b4042d1115a830c@mail.gmail.com> (raw)
In-Reply-To: <m2zl3fg26j.fsf@boostpro.com>
On Thu, Feb 11, 2010 at 11:36 AM, David Abrahams <dave@boostpro.com> wrote:
>
> If I am collaborating mostly with one other person, I typically want to
> pull from his publicly-readable repo and push to mine (on which I have
> write permission). Is there any way to set things up so “git pull” and
> “git push” without additional arguments will do this by default?
>
> Thanks,
>
> --
> Dave Abrahams Meet me at BoostCon: http://www.boostcon.com
> BoostPro Computing
> http://www.boostpro.com
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Yes there is a way. I haven't used it myself but search this list and
you'll find plenty of references.
(disclaimer: the following is what I think you can do based on some
vague recollection and some man pages)
Taking a quick look at the git push --help you'll see the following
snippet of configuration.
[remote "<name>"]
url = <url>
pushurl = <pushurl>
push = <refspec>
fetch = <refspec>
so I think if you just add the pushurl to your .git/config should do
what you've asked
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git://git.kernel.org/pub/scm/git/git.git
pushurl = git://git.example.com/yourrepo.git
For your own sanity I suggest doing this by adding your repository as
a separate remote.
e.g.
git remote add yourrepo git://git.example.com/yourrepo.git
git push yourrepo master:refs/heads/master # the first time
git push yourrepo # subsequent times
There probably is a way to tell push to use something other than
"origin" by default but I don't know/can't find it.
next prev parent reply other threads:[~2010-02-11 18:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-11 16:36 Separate default push/pull? David Abrahams
2010-02-11 18:57 ` Chris Packham [this message]
2010-02-12 0:14 ` Jeff King
2010-02-12 0:49 ` Junio C Hamano
2010-02-12 1:05 ` Jeff King
2010-02-12 5:57 ` Junio C Hamano
2010-02-13 11:58 ` Jeff King
2010-02-12 2:32 ` David Abrahams
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=a038bef51002111057l382ed55fy6b4042d1115a830c@mail.gmail.com \
--to=judge.packham@gmail.com \
--cc=dave@boostpro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).