* H.Merijn Brand <h.m.brand@xs4all.nl> [2008-11-14 13:35]:
> On Fri, 14 Nov 2008 09:32:53 +0000, Nicholas Clark <nick@ccl4.org>
> wrote:
> > But I've heard different plans on how commits get back - is
> > it via an ssh tunnel, is it a git push (whatever that is).
>
> $ git remote add git+ssh://perl5.git.perl.org/perl.git
> :
> :
> $ git pull
> :
> :
> $ git push
>
> I think. Correct?
Roughly. But wrong on a lot of details. The remote needs a name,
and the syntax for SSH-based remotes is not URLish, but SSHish:
git remote add origin nick@perl5.git.perl.org:perl.git
Next, git-pull is actually git-fetch (which downloads commits you
are missing) *plus* git-merge. Because of the latter, you have to
say which branch you want to merge. And since git-pull is used to
merge changes from a remote branch, and you can have several
remotes configured (it’s a DVCS!), you also have to specify which
remote, to make it unambiguous. So based on the above you’d say
git pull origin master # or some other branch
Or you can say just
git fetch
in which case you’ll merely slurp in all the new stuff from all
your remotes without merging any of them to your current branch
yet. The above git-pull command is equivalent to this sequence:
git fetch origin
git merge origin/master
If you do a git-fetch instead of a git-pull, you can do things
like
git log ..origin
to see what’s happened in `public` without merging it yet.
Next, git-push defaults to pushing to `origin`. If your remote is
called something else (I usually set up my published repo as a
remote called `public`), you have to specify it:
git push public
If you have push access to all of your remotes, and you want to
push to all, you can also pass `--all` instead of a particular
remote. (But you can also set up several URLs for the same remote
by editing `.git/config`, which gives you more granular choices
and seems like better option to me: I add the URLs of all public
repos to my `public` remote so they’re always pushed all at once.)
Regards,