P
P
Pychev Anatoly2019-11-21 03:21:16
git
Pychev Anatoly, 2019-11-21 03:21:16

git stash not found worktree error?

Hello
Please advise.
There is a site. located on the server along the path home/siteua/site.ua/www/ It has git no longer empty and connected to github. The disadvantage of this whole construction is that git is available via an external link. But the main trouble is that if you need to restore it from a backup, then the git folder is also restored and HEAD already points to previous commits.
I decided to move the git folder to the directory above. Found the guide moved.
I wrote in the config worktree = ../www/.
I added a .git file in the working directory and wrote down the path to the git location in it. gitdir: ../
The git status command works out and shows the changes, but the git stash command gives an error

fatal: /usr/libexec/git-core/git-stash cannot be used without a working tree.

I understand that somewhere the path is not added or incorrectly written. Tried different options in the config.
Please help. how to correctly write the paths so that git would work from the parent directory, but look at the child /www/
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shitskov, 2019-11-21
@Zarom

I think worktree = ./www/
PS
This is not a design problem for you, but an error in the nginx / apache configuration.

  1. Why save .git in backups?
  2. If, nevertheless, for some reason it is saved, then why not just pull the desired branch or tag after unrolling?
  3. Why deploy these backups, if you can just roll back the git?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question