Why does GIT say "fatal: this operation should be performed in the work tree" when exporting from a bare repo?

if I export from a bare GIT repository using the GIT archive command. I get the error message: "fatal: this operation should be performed in the work tree", although the export is working correctly.

So my question is: are there any problems when exporting from a bare repository? I checked the exported archive and it looks good.

+3
source share
2 answers

In fact, I do not receive this warning - I am sure that it was an error that was solved sometime after the version that you are using. I can’t say exactly when, because I was not even able to play it at all (I tried v1.5.3.4, v1.6.2 and the assembly from the current wizard.)

+4
source

As stated in the “backup project that uses git” , git bundleit would be more appropriate.

git archive just creates tarballs of trees (snapshots), but does not save commit and history.

But you can be behind a simple copy, and not with the history combined in one file.

git archive ( Git export"), , .

+1

Source: https://habr.com/ru/post/1748993/


All Articles