# Moving git

11 messages from 2009-10-16 to 2009-10-20. Participants: Richard Lee, Matthieu Moy, Santi Béjar, Richard, Todd Zullinger, rhlee, Daniel Barkalow.
Thread: https://gitlist.dev/t/21262

## Richard Lee, 2009-10-16 14:58

Subject: Moving git
Message-ID: <25926819.post@talk.nabble.com>
URL: https://gitlist.dev/e/25926819.post%40talk.nabble.com

```

Hi Git forum,

I've just started using git yesterday, so I'm very new. So please excuse if
I've done something the wrong way.

I cloned a git directory/repository? and then moved it. I'm trying to prune
branches and it gives

]fatal: '/var/www/vhosts/mydomain.co.uk/b2.git': unable to chdir or not a
git archive
fatal: The remote end hung up unexpectedly
ls-remote --heads /var/www/vhosts/mydomain.co.uk/b2.git: command returned
error: 1

b2.git was the cloned bare thing I create following the instruction here:

http://book.git-scm.com/4_setting_up_a_private_repository.html

Is there someway I can get git to update the git base directory?

Richard

-- 
View this message in context: http://www.nabble.com/Moving-git-tp25926819p25926819.html
Sent from the git mailing list archive at Nabble.com.

```

## Matthieu Moy, 2009-10-16 15:17

Subject: Re: Moving git
Message-ID: <vpqk4yv2ws6.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqk4yv2ws6.fsf%40bauges.imag.fr
In-Reply-To: <25926819.post@talk.nabble.com>

```
Richard Lee <richard@webdezign.co.uk> writes:

> Hi Git forum,
>
> I've just started using git yesterday, so I'm very new. So please excuse if
> I've done something the wrong way.
>
> I cloned a git directory/repository? and then moved it. I'm trying to prune
> branches and it gives

Which command did you type?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Santi Béjar, 2009-10-16 15:41

Subject: Re: Moving git
Message-ID: <adf1fd3d0910160841h513dea5ag6f9ace400afd1c2e@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d0910160841h513dea5ag6f9ace400afd1c2e%40mail.gmail.com
In-Reply-To: <25926819.post@talk.nabble.com>

```
On Fri, Oct 16, 2009 at 4:58 PM, Richard Lee <richard@webdezign.co.uk> wrote:
> I cloned a git directory/repository? and then moved it.

So you moved the original repository. Then you have to update the url
in the new/cloned repositories. I would edit .git/config and changed
the url entries with the new value.

HTH,
Santi

```

## Richard, 2009-10-16 15:45

Subject: RE: Moving git
Message-ID: <8440EA2C12E50645A68C4AA988716651244654@SERVER.webdezign.local>
URL: https://gitlist.dev/e/8440EA2C12E50645A68C4AA988716651244654%40SERVER.webdezign.local
In-Reply-To: <vpqk4yv2ws6.fsf@bauges.imag.fr>

```
Hi Matthieu,


Thanks for replying.

Basically, I used git-svn to import from git. I'm trying to get rid of
the origin branch. (I probably should have used the no-metdata switch).

The command I used was

git branch prune origin

I tried "git remote rm origin" which worked on my local win32 machine,
but the linux server I was working on did not recognise "git remote rm".

I'm pretty sure git stores the current git directory as I've seen the
--git-dir and --work-tree environment variables. Plus I also noticed on
msysgit gives " Local uncommitted changes, not checked in to index"
sometimes, when I move the directory.


Regards,

Richard

-----Original Message-----
From: Matthieu Moy [mailto:Matthieu.Moy@grenoble-inp.fr] 
Sent: 16 October 2009 16:17
To: Richard
Cc: git@vger.kernel.org
Subject: Re: Moving git

Richard Lee <richard@webdezign.co.uk> writes:

> Hi Git forum,
>
> I've just started using git yesterday, so I'm very new. So please
excuse if
> I've done something the wrong way.
>
> I cloned a git directory/repository? and then moved it. I'm trying to
prune
> branches and it gives

Which command did you type?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Matthieu Moy, 2009-10-16 16:11

Subject: Re: Moving git
Message-ID: <vpqbpk71fox.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqbpk71fox.fsf%40bauges.imag.fr
In-Reply-To: <8440EA2C12E50645A68C4AA988716651244654@SERVER.webdezign.local>

```
"Richard" <richard@webdezign.co.uk> writes:

> Hi Matthieu,
>
>
> Thanks for replying.
>
> Basically, I used git-svn to import from git. I'm trying to get rid of
> the origin branch. (I probably should have used the no-metdata switch).
>
> The command I used was
>
> git branch prune origin
>
> I tried "git remote rm origin" which worked on my local win32 machine,
> but the linux server I was working on did not recognise "git remote rm".
>
> I'm pretty sure git stores the current git directory as I've seen the
> --git-dir and --work-tree environment variables.

Git doesn't store them by default for the current repository. "git
rev-parse --git-dir" guesses where your .git/ directory is (looking
for ./.git/, ../.git, and so on). OTOH, Git stores URLs for remote
repositories (see .git/config).

> Plus I also noticed on msysgit gives " Local uncommitted changes,
> not checked in to index" sometimes, when I move the directory.

I don't know msysgit, but I guess you'll have problems if your
repository is on a FAT filesystem. Is it the case?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Richard Lee, 2009-10-16 17:04

Subject: Re: Moving git
Message-ID: <25928820.post@talk.nabble.com>
URL: https://gitlist.dev/e/25928820.post%40talk.nabble.com
In-Reply-To: <25926819.post@talk.nabble.com>

```

Hi all,

Thank you to Matthieu Moy and Santi Béjar who both told me to check
.git/config.

The reason why I had problems was because I was using git config --get-all
(with no regex). I then used git config -l and saw the remote local path to
the repository that I used to clone.

The reason I had problem with git remote rm was because I was using version
1.5.2 as I installed it from yum. (This is what I hate about CentOS, all the
repositories are old as dirt.) I compiled version 1.6.5 and the command was
there. I think the ability probably was there in 1.5.2, but you probably had
to do some extra magic stuff to completely remove the repository. And by
trying to git remote prune didn't help either as I had deleted the local
repository.

I now could "git remote rm origin" with no problems after moving the whole
git directory.

Richard
-- 
View this message in context: http://www.nabble.com/Moving-git-tp25926819p25928820.html
Sent from the git mailing list archive at Nabble.com.

```

## Matthieu Moy, 2009-10-16 17:10

Subject: Re: Moving git
Message-ID: <vpq8wfbz2lc.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpq8wfbz2lc.fsf%40bauges.imag.fr
In-Reply-To: <25928820.post@talk.nabble.com>

```
Richard Lee <richard@webdezign.co.uk> writes:

> The reason I had problem with git remote rm was because I was using version
> 1.5.2 as I installed it from yum. (This is what I hate about CentOS, all the
> repositories are old as dirt.) I compiled version 1.6.5 and the command was
> there.

It's a good idea to have a recent version of Git. The
user-friendlyness of Git is progressing quickly, and each new version
brings a myriad of little details that will make your life easier
while learning Git ;-).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Todd Zullinger, 2009-10-16 18:42

Subject: Re: Moving git
Message-ID: <20091016184251.GG19511@inocybe.localdomain>
URL: https://gitlist.dev/e/20091016184251.GG19511%40inocybe.localdomain
In-Reply-To: <25928820.post@talk.nabble.com>

```
Richard Lee wrote:
> The reason I had problem with git remote rm was because I was using
> version 1.5.2 as I installed it from yum. (This is what I hate about
> CentOS, all the repositories are old as dirt.)

Not that it's much newer, but if you use the EPEL repository, 1.5.5.6
is available.

> I compiled version 1.6.5 and the command was there.

And if it helps, the Fedora package is intended to be able to build
cleanly on CentOS as well -- though it depends on some macro settings
available in the buildsys-macros package found at:

    http://buildsys.fedoraproject.org/buildgroups/rhel5/

...in the proper directory for your architecture.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Every time I close the door on reality, it comes in through the
windows.


```

## rhlee, 2009-10-19 09:30

Subject: Re: Moving git
Message-ID: <1255944627643-3848039.post@n2.nabble.com>
URL: https://gitlist.dev/e/1255944627643-3848039.post%40n2.nabble.com
In-Reply-To: <20091016184251.GG19511@inocybe.localdomain>

```

Thanks, I've been looking for something like EPEL for a long time.
-- 
View this message in context: http://n2.nabble.com/Moving-git-tp3836198p3848039.html
Sent from the git mailing list archive at Nabble.com.

```

## Daniel Barkalow, 2009-10-20 16:33

Subject: Re: Moving git
Message-ID: <alpine.LNX.2.00.0910201222080.14365@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.2.00.0910201222080.14365%40iabervon.org
In-Reply-To: <25926819.post@talk.nabble.com>

```
On Tue, 20 Oct 2009, Richard Lee wrote:

> 
> Hi Git forum,
> 
> I've just started using git yesterday, so I'm very new. So please excuse if
> I've done something the wrong way.
> 
> I cloned a git directory/repository? and then moved it. I'm trying to prune
> branches and it gives
> 
> ]fatal: '/var/www/vhosts/mydomain.co.uk/b2.git': unable to chdir or not a
> git archive
> fatal: The remote end hung up unexpectedly
> ls-remote --heads /var/www/vhosts/mydomain.co.uk/b2.git: command returned
> error: 1
> 
> b2.git was the cloned bare thing I create following the instruction here:
> 
> http://book.git-scm.com/4_setting_up_a_private_repository.html
> 
> Is there someway I can get git to update the git base directory?

The exact problem, I think, is that your clone has saved the original 
location of the bare repository as the default upstream repository 
location, and now it's not there. (It's a little hard to tell without the 
command that you were running when you got the error.)

If you edit the clone's .git/config, you should see the old location in a 
'[remote "origin"]' section. If you change this to the new location, 
everything should work. You can also do it with "git remote" somehow, but 
I personally just edit the config file, so I don't know the details.

	-Daniel
*This .sig left intentionally blank*

```

## Richard, 2009-10-20 16:37

Subject: RE: Moving git
Message-ID: <8440EA2C12E50645A68C4AA9887166512446DD@SERVER.webdezign.local>
URL: https://gitlist.dev/e/8440EA2C12E50645A68C4AA9887166512446DD%40SERVER.webdezign.local
In-Reply-To: <alpine.LNX.2.00.0910201222080.14365@iabervon.org>

```
Thanks to anyone for the reply, but this issue has been resolved. I
might have submitted this several times, but Nabble keeps on nagging me
about multiple posts. So I'm just going to delete it.

-----Original Message-----
From: Daniel Barkalow [mailto:barkalow@iabervon.org] 
Sent: 20 October 2009 17:34
To: Richard
Cc: git@vger.kernel.org
Subject: Re: Moving git

On Tue, 20 Oct 2009, Richard Lee wrote:

> 
> Hi Git forum,
> 
> I've just started using git yesterday, so I'm very new. So please
excuse if
> I've done something the wrong way.
> 
> I cloned a git directory/repository? and then moved it. I'm trying to
prune
> branches and it gives
> 
> ]fatal: '/var/www/vhosts/mydomain.co.uk/b2.git': unable to chdir or
not a
> git archive
> fatal: The remote end hung up unexpectedly
> ls-remote --heads /var/www/vhosts/mydomain.co.uk/b2.git: command
returned
> error: 1
> 
> b2.git was the cloned bare thing I create following the instruction
here:
> 
> http://book.git-scm.com/4_setting_up_a_private_repository.html
> 
> Is there someway I can get git to update the git base directory?

The exact problem, I think, is that your clone has saved the original 
location of the bare repository as the default upstream repository 
location, and now it's not there. (It's a little hard to tell without
the 
command that you were running when you got the error.)

If you edit the clone's .git/config, you should see the old location in
a 
'[remote "origin"]' section. If you change this to the new location, 
everything should work. You can also do it with "git remote" somehow,
but 
I personally just edit the config file, so I don't know the details.

	-Daniel
*This .sig left intentionally blank*

```
