New to git: sorry for obvious question.

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

New to git: sorry for obvious question.

From: Paul Gardiner <hidden>
Date: 2016-06-15 22:44:10

Hi,

I've moved a project from CVS on sourceforge to git on repo.or.cz.  I
want a local mirror on my own home server, so that it appears amongst
the projects shown by my own gitweb set up, and so it gets caught by
my backup system.  I've created the mirror with

   git clone --bare <remote-url> <local-dir>

and that seems fine.  But how do I now keep it up to date.  I was
guessing a cron job doing some sort of git pull, but pull doesn't
look to work on --bare proj.git type repositories.

Any help most apprecieated.

Cheers,
	Paul.

Re: New to git: sorry for obvious question.

From: Luciano Rocha <hidden>
Date: 2016-06-15 22:44:10

On Mon, Feb 04, 2008 at 09:56:00AM +0000, Paul Gardiner wrote:
 Hi,

 I've moved a project from CVS on sourceforge to git on repo.or.cz.  I
 want a local mirror on my own home server, so that it appears amongst
 the projects shown by my own gitweb set up, and so it gets caught by
 my backup system.  I've created the mirror with

   git clone --bare <remote-url> <local-dir>

 and that seems fine.  But how do I now keep it up to date.  I was
 guessing a cron job doing some sort of git pull, but pull doesn't
 look to work on --bare proj.git type repositories.
You want git fetch. Git pull also updates the working copy, which you
don't have.

Also, git clone --bare doesn't set up the origin configuration, and I
have to do it by hand:
  git config remote.origin.url "$url"
  git config remote.origin.fetch "+refs/heads/*:refs/heads/*"

As for keeping clones up to date, I include a script I use daily for
that purpose.

-- 
Luciano Rocha [off-list ref]
Eurotux Informática, S.A. <http://www.eurotux.com/>

Re: New to git: sorry for obvious question.

From: Paul Gardiner <hidden>
Date: 2016-06-15 22:44:10

Luciano Rocha wrote:
On Mon, Feb 04, 2008 at 09:56:00AM +0000, Paul Gardiner wrote:
quoted
 Hi,

 I've moved a project from CVS on sourceforge to git on repo.or.cz.  I
 want a local mirror on my own home server, so that it appears amongst
 the projects shown by my own gitweb set up, and so it gets caught by
 my backup system.  I've created the mirror with

   git clone --bare <remote-url> <local-dir>

 and that seems fine.  But how do I now keep it up to date.  I was
 guessing a cron job doing some sort of git pull, but pull doesn't
 look to work on --bare proj.git type repositories.
You want git fetch. Git pull also updates the working copy, which you
don't have.

Also, git clone --bare doesn't set up the origin configuration, and I
have to do it by hand:
  git config remote.origin.url "$url"
  git config remote.origin.fetch "+refs/heads/*:refs/heads/*"
Brilliant!! That works.

So why wouldn't git-fetch work when, instead of setting up the origin
config, I put the url and refspec on the commandline? - not that it
matters, just interested.

Cheers,
	Paul.

Re: New to git: sorry for obvious question.

From: Boaz Harrosh <hidden>
Date: 2016-06-15 22:44:10

On Mon, Feb 04 2008 at 12:50 +0200, Luciano Rocha [off-list ref] wrote:
On Mon, Feb 04, 2008 at 09:56:00AM +0000, Paul Gardiner wrote:
quoted
 Hi,

 I've moved a project from CVS on sourceforge to git on repo.or.cz.  I
 want a local mirror on my own home server, so that it appears amongst
 the projects shown by my own gitweb set up, and so it gets caught by
 my backup system.  I've created the mirror with

   git clone --bare <remote-url> <local-dir>

 and that seems fine.  But how do I now keep it up to date.  I was
 guessing a cron job doing some sort of git pull, but pull doesn't
 look to work on --bare proj.git type repositories.
You want git fetch. Git pull also updates the working copy, which you
don't have.

Also, git clone --bare doesn't set up the origin configuration, and I
have to do it by hand:
  git config remote.origin.url "$url"
  git config remote.origin.fetch "+refs/heads/*:refs/heads/*"
Better do "git-remote add URL" then manual addition as above.

Boaz

Re: New to git: sorry for obvious question.

From: Paul Gardiner <hidden>
Date: 2016-06-15 22:44:10

Boaz Harrosh wrote:
On Mon, Feb 04 2008 at 12:50 +0200, Luciano Rocha [off-list ref] wrote:
quoted
Also, git clone --bare doesn't set up the origin configuration, and I
have to do it by hand:
  git config remote.origin.url "$url"
  git config remote.origin.fetch "+refs/heads/*:refs/heads/*"
Better do "git-remote add URL" then manual addition as above.
Would that be git-remote add --mirror origin URL?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help