Does GitLab support git archive command with SHA id

758 views
Skip to first unread message

Ashwini

unread,
Feb 21, 2017, 9:20:06 AM2/21/17
to GitLab
Hi

Does GitLab support git archive command with SHA id? Instead of refs ?

when trying to get the data the error occurs:

remote: fatal: no such ref: a2501e8bea4b8fea43f55b780a692809207a0260
remote: git upload-archive: archiver died with error
fatal: sent error to the client: git upload-archive: archiver died with error


where as the reference exist..!!

Please help

Regards
Ashwini

Aleksey Tsalolikhin

unread,
Feb 21, 2017, 10:27:08 AM2/21/17
to gitl...@googlegroups.com
What is the command that you are running?

I don't have any trouble with "git archive" but it doesn't try to upload anything:

$ git archive -o latest.zip ae6c3bc47
$ ls -lh latest.zip 
-rw-rw-r-- 1 atsaloli atsaloli 1.1K Feb 21 07:23 latest.zip

Best,
Aleksey
-- 
Need training on Git or GitLab CI?  Email trai...@verticalsysadmin.com.


--
You received this message because you are subscribed to the Google Groups "GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/3576cabf-a78e-47bd-ace7-ec1a589fd8db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ashwini

unread,
Feb 22, 2017, 1:24:30 AM2/22/17
to GitLab
Hi Aleksey,

We are trying the below command with hash id

git archive --remote=git@<server_name:<repo_path> a2501e8bea4b8fea43f55b780a692809207a0260 build/build.common


thanks
Ashwini

On Tuesday, February 21, 2017 at 8:57:08 PM UTC+5:30, Aleksey Tsalolikhin wrote:
What is the command that you are running?

I don't have any trouble with "git archive" but it doesn't try to upload anything:

$ git archive -o latest.zip ae6c3bc47
$ ls -lh latest.zip 
-rw-rw-r-- 1 atsaloli atsaloli 1.1K Feb 21 07:23 latest.zip

Best,
Aleksey
-- 
Need training on Git or GitLab CI?  Email trai...@verticalsysadmin.com.


On Tue, Feb 21, 2017 at 6:20 AM, Ashwini <ashu.r...@gmail.com> wrote:
Hi

Does GitLab support git archive command with SHA id? Instead of refs ?

when trying to get the data the error occurs:

remote: fatal: no such ref: a2501e8bea4b8fea43f55b780a692809207a0260
remote: git upload-archive: archiver died with error
fatal: sent error to the client: git upload-archive: archiver died with error


where as the reference exist..!!

Please help

Regards
Ashwini

--
You received this message because you are subscribed to the Google Groups "GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+u...@googlegroups.com.

Aleksey Tsalolikhin

unread,
Feb 22, 2017, 8:16:49 AM2/22/17
to gitl...@googlegroups.com
Got it.  Git does this by design -- see the excellent answer at https://bitbucket.org/site/master/issues/9243/git-acrhive-remote-does-not-work which links to the Git source code showing that Git only accepts refs (e.g. HEAD or branchname) here, not SHA1's.

-- 
Need training on CFEngine, Git or Time Management?  Email trai...@verticalsysadmin.com.

To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/56e0b9a5-93ba-4116-977b-dad0dbcfc2ea%40googlegroups.com.

Aleksey Tsalolikhin

unread,
Feb 22, 2017, 8:25:57 AM2/22/17
to gitl...@googlegroups.com
P.S. This restriction was implemented in 1.7.8.1:

Git v1.7.8.1 Release Notes
==========================

Fixes since v1.7.8
------------------

...
 * "git archive" mistakenly allowed remote clients to ask for commits
   that are not at the tip of any ref.
...


On Wed, Feb 22, 2017 at 5:16 AM, Aleksey Tsalolikhin <ale...@verticalsysadmin.com> wrote:
Got it.  Git does this by design -- see the excellent answer at https://bitbucket.org/site/master/issues/9243/git-acrhive-remote-does-not-work which links to the Git source code showing that Git only accepts refs (e.g. HEAD or branchname) here, not SHA1's.

Ashwini

unread,
Apr 10, 2017, 3:38:43 AM4/10/17
to GitLab
Hi Aleksey,

Thanks for providing the detailed information along with documents:):) 
It was really helpful.

Regards
Ashwini 


Aleksey Tsalolikhin

unread,
Apr 10, 2017, 6:51:10 AM4/10/17
to gitl...@googlegroups.com
You are very welcome, Ashwini! :-) I'm so glad to hear it was useful! 

Aleksey Tsalolikhin
Git/GitLab training provider

To unsubscribe from this group and stop receiving emails from it, send an email to gitlabhq+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/24106cf0-b0c1-4852-bbda-405b6765786a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages