Resolution Options for Reference Tags created with double quotes in Windows

805 views
Skip to first unread message

Uma Lingesh Family

unread,
Feb 13, 2017, 4:02:41 PM2/13/17
to git-for-windows

In error I created a tag with a build number within double quotes.

 

Now we get the following error because windows file system is not able to identify with double quotes in the name.

 

2017-02-09T19:39:22.0551792Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin

2017-02-09T19:39:22.9717910Z error: cannot lock ref 'refs/tags/"<tagname>"': Unable to create ''<reponame>/.git/refs/tags/"<tagname>".lock': Invalid argument

2017-02-09T19:39:22.9717910Z 

2017-02-09T19:39:22.9717910Z  ! [new tag]         "<tagname>" -> "<tagname>"  (unable to update local ref)

2017-02-09T19:39:23.0967934Z ##[error]Git fetch failed with exit code: 1

 

Using Visual Studio if we clone/pull/fetch the repository, we get the following error:

Error encountered while cloning the remote repository: Invalid reference name 'refs/tags/"<tagname>"'.

 

We tried pruning remote/local respoistories, renaming tags. But this did not help in getting the issue fixed.

 

Is there any work around to resolve this kind of issue?

 


Uma Lingesh Family

unread,
Feb 13, 2017, 4:02:42 PM2/13/17
to git-for-windows

In error I created a tag with a build number within double quotes.

 

Now we notice the following error because windows file system is not able to identify with double quotes in the name.

 

2017-02-09T19:39:22.0551792Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin

2017-02-09T19:39:22.9717910Z error: cannot lock ref 'refs/tags/"<name>"': Unable to create '.git/refs/tags/"20170208.4".lock': Invalid argument

2017-02-09T19:39:22.9717910Z From 

2017-02-09T19:39:22.9717910Z  ! [new tag]         "<name>" -> "<name>"  (unable to update local ref)

2017-02-09T19:39:23.0967934Z ##[error]Git fetch failed with exit code: 1

 

Using Visual Studio if we clone/pull/fetch the repository, we get the following error:

Error encountered while cloning the remote repository: Invalid reference name 'refs/tags/"<name>"'.

 

We tried pruning remote/local repositories, renaming tags. But this did not help in getting the issue fixed.

 

Is there any work around to resolve this kind of issue?

 

Thanks

Uma

Johannes Sixt

unread,
Feb 13, 2017, 4:22:31 PM2/13/17
to Uma Lingesh Family, git-for-windows
Am 10.02.2017 um 22:19 schrieb Uma Lingesh Family:
> In error I created a tag with a build number within double quotes.
>
> Now we get the following error because windows file system is not able
> to identify with double quotes in the name.
>...
>
> Is there any work around to resolve this kind of issue?

I suggest to remove the tag from the server:

git push origin :/refs/tags/"\"<name>\""

-- Hannes

Uma Lingesh Family

unread,
Feb 13, 2017, 5:07:14 PM2/13/17
to git-for-windows, umalinge...@gmail.com
We tried the following
 git push origin :/refs/tags/"20170208.4" 
git push origin :/refs/tags/"\"20170208.4\"" 
git push origin :/refs/tags/\"20170208.4\"
All the above are giving the error "fatal: remote part of refspec is not a valid name in :/refs/tags/..."

Also we tried git push origin :/refs/tags/20170208.4

For this it gave a warning : Deleting non existent tag 20170208.4

Any other ways we can delete this tag?

Johannes Sixt

unread,
Feb 14, 2017, 1:07:21 AM2/14/17
to Uma Lingesh Family, git-for-windows
Am 13.02.2017 um 23:07 schrieb Uma Lingesh Family:
> We tried the following
> git push origin :/refs/tags/"20170208.4"
> git push origin :/refs/tags/"\"20170208.4\""
> git push origin :/refs/tags/\"20170208.4\"
> All the above are giving the error "fatal: remote part of refspec is not
> a valid name in :/refs/tags/..."

Sorry, make that

git push origin :refs/tags/"\"20170208.4\""

-- Hannes

Uma Lingesh Family

unread,
Feb 17, 2017, 3:00:54 PM2/17/17
to Johannes Sixt, git-for-windows
Thanks a bunch. This helped. We were able to delete this in remote.

However we tried to delete in the same way in local using the below command

git tag -d "\"20170208.4\""

But it throws error: Cannot lock ref 'refs/tags/"20170208.4":

Any help on deleting from local is appreciated.

Johannes Sixt

unread,
Feb 17, 2017, 4:05:00 PM2/17/17
to Uma Lingesh Family, git-for-windows
Am 17.02.2017 um 21:00 schrieb Uma Lingesh Family:
> Thanks a bunch. This helped. We were able to delete this in remote.
>
> However we tried to delete in the same way in local using the below command
>
> git tag -d "\"20170208.4\""
>
> But it throws error: Cannot lock ref 'refs/tags/"20170208.4":
>
> Any help on deleting from local is appreciated.

Make a backup copy of the file .git\packed-refs (or better yet, of the
whole .git directory). Then edit the file; remove the line with the
unwanted entry and the next line, which begins with a ^ character.

-- Hannes

Uma Lingesh Family

unread,
Feb 21, 2017, 12:41:25 PM2/21/17
to Johannes Sixt, git-for-windows
Thanks Johannes. It worked!


Reply all
Reply to author
Forward
0 new messages