# error: cannot lock ref 'refs/remotes/origin/*'

9 messages from 2008-06-16 to 2008-06-17. Participants: Nicolas Bock, Johannes Schindelin, Johan Herland, Jakub Narebski.
Thread: https://gitlist.dev/t/13981

## Nicolas Bock, 2008-06-16 16:53

Subject: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <1213635227.17814.6.camel@localhost>
URL: https://gitlist.dev/e/1213635227.17814.6.camel%40localhost

```
Hello list,

when running "git gc" I get the following error message as of late:

$ git gc
error: cannot lock ref 'refs/remotes/origin/*'
error: failed to run reflog

When I rsync the directory tree to another machine, I can run "git gc"
without any error messages. What exactly does this error mean? Why would
locking fail?

Thanks already,

nick

```

## Nicolas Bock, 2008-06-17 01:47

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <1213667245.14393.3.camel@localhost>
URL: https://gitlist.dev/e/1213667245.14393.3.camel%40localhost
In-Reply-To: <1213635227.17814.6.camel@localhost>

```
I realized that I recently upgraded from version 1.5.3.7 to 1.5.4.5. I
double checked and downgraded again, and yes, I don't have any problems
running "git gc" with the older version, but I get the below error
message with the newer version of git.

nick


On Mon, 2008-06-16 at 10:53 -0600, Nicolas Bock wrote:
> Hello list,
> 
> when running "git gc" I get the following error message as of late:
> 
> $ git gc
> error: cannot lock ref 'refs/remotes/origin/*'
> error: failed to run reflog
> 
> When I rsync the directory tree to another machine, I can run "git gc"
> without any error messages. What exactly does this error mean? Why would
> locking fail?
> 
> Thanks already,
> 
> nick
> 
> --
> 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

```

## Johannes Schindelin, 2008-06-17 10:41

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <alpine.DEB.1.00.0806171140470.6439@racer>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0806171140470.6439%40racer
In-Reply-To: <1213667245.14393.3.camel@localhost>

```
Hi,

On Mon, 16 Jun 2008, Nicolas Bock wrote:

> > $ git gc
> > error: cannot lock ref 'refs/remotes/origin/*'
> > error: failed to run reflog

This is a bogus ref name.  Hrm.  Can you look with "git show-ref" if you 
have (by some funny accident) an invalid ref there?

Ciao,
Dscho

```

## Nicolas Bock, 2008-06-17 14:22

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <1213712520.6400.1.camel@localhost>
URL: https://gitlist.dev/e/1213712520.6400.1.camel%40localhost
In-Reply-To: <alpine.DEB.1.00.0806171140470.6439@racer>

```
This is what I get:

$ git show-ref
a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*
3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/remotes/origin/master

in what sense is this ref "bogus"? Is it syntactically incorrect?



On Tue, 2008-06-17 at 11:41 +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Mon, 16 Jun 2008, Nicolas Bock wrote:
> 
> > > $ git gc
> > > error: cannot lock ref 'refs/remotes/origin/*'
> > > error: failed to run reflog
> 
> This is a bogus ref name.  Hrm.  Can you look with "git show-ref" if you 
> have (by some funny accident) an invalid ref there?
> 
> Ciao,
> Dscho
> 
> --
> 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

```

## Johan Herland, 2008-06-17 14:29

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <200806171629.06570.johan@herland.net>
URL: https://gitlist.dev/e/200806171629.06570.johan%40herland.net
In-Reply-To: <1213712520.6400.1.camel@localhost>

```
On Tuesday 17 June 2008, Nicolas Bock wrote:
> This is what I get:
>
> $ git show-ref
> a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
> 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
> 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
> ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*
> 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/remotes/origin/master
>
> in what sense is this ref "bogus"? Is it syntactically incorrect?

Yes, According to "man git-check-ref-format", asterisk is NOT allowed in 
a ref name.


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

```

## Johannes Schindelin, 2008-06-17 14:46

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <alpine.DEB.1.00.0806171645300.2308@eeepc-johanness>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0806171645300.2308%40eeepc-johanness
In-Reply-To: <1213712520.6400.1.camel@localhost>

```
Hi,

On Tue, 17 Jun 2008, Nicolas Bock wrote:

> This is what I get:
> 
> $ git show-ref
> a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
> 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
> 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
> ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*

This is the culprit.  It is obviously a wrong name: "*" is not allowed.

Hth,
Dscho

```

## Nicolas Bock, 2008-06-17 15:49

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <1213717788.13390.2.camel@localhost>
URL: https://gitlist.dev/e/1213717788.13390.2.camel%40localhost
In-Reply-To: <200806171629.06570.johan@herland.net>

```
I guess I don't understand refs. I figured that since I have

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

set, I should have a ref refs/remotes/origin/* as well.



On Tue, 2008-06-17 at 16:29 +0200, Johan Herland wrote:
> On Tuesday 17 June 2008, Nicolas Bock wrote:
> > This is what I get:
> >
> > $ git show-ref
> > a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
> > 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
> > 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
> > ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*
> > 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/remotes/origin/master
> >
> > in what sense is this ref "bogus"? Is it syntactically incorrect?
> 
> Yes, According to "man git-check-ref-format", asterisk is NOT allowed in 
> a ref name.
> 
> 
> ...Johan
> 

```

## Jakub Narebski, 2008-06-17 19:09

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <m3fxrbop4g.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3fxrbop4g.fsf%40localhost.localdomain
In-Reply-To: <1213717788.13390.2.camel@localhost>

```
Nicolas Bock <nbock@lanl.gov> writes:

> I guess I don't understand refs. I figured that since I have
> 
> remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
> 
> set, I should have a ref refs/remotes/origin/* as well.

The above is _globbing_ refspec, it means that it maps 
"refs/heads/<name>" branch in remote repository to 
"refs/remotes/origin/<name>" remote-tracking branch in local
repository.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## Nicolas Bock, 2008-06-17 21:00

Subject: Re: error: cannot lock ref 'refs/remotes/origin/*'
Message-ID: <1213736407.2490.9.camel@localhost>
URL: https://gitlist.dev/e/1213736407.2490.9.camel%40localhost
In-Reply-To: <m3fxrbop4g.fsf@localhost.localdomain>

```
Thanks, that explains it..


nick

On Tue, 2008-06-17 at 12:09 -0700, Jakub Narebski wrote:
> Nicolas Bock <nbock@lanl.gov> writes:
> 
> > I guess I don't understand refs. I figured that since I have
> > 
> > remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
> > 
> > set, I should have a ref refs/remotes/origin/* as well.
> 
> The above is _globbing_ refspec, it means that it maps 
> "refs/heads/<name>" branch in remote repository to 
> "refs/remotes/origin/<name>" remote-tracking branch in local
> repository.
> 

```
