N
N
Nurlan2015-09-23 11:55:53
git
Nurlan, 2015-09-23 11:55:53

Check which files are not in the git repository?

Greetings.
We have a GIT repository here /var/git_repository/site.git
A post-receive hook is configured so that after the commit, the code is copied to the working folder:

#!/bin/bash 

read oldrev newrev refname
if [ refs/heads/master = $refname ]; then
        git --work-tree=/var/www/site/ --git-dir=/var/git_repository/site.git/ checkout -f
        chmod 775 -R /var/www/site
        log=$(git log -n 1 --name-only --pretty=format:master)
fi

From time to time, laziness and stupidity took their toll, so that files loaded directly appeared in the working folder.
How to check which files are not in the turnip? git status doesn't help. it's not a native folder. git init && git status there. Please tell me what to do or read,

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nurlan, 2015-09-23
@daager

Decided like this:
Everything ingenious is simple.
PS As always, ask and the answer will come to mind.

M
Melkij, 2015-09-23
@melkij

diff -qr --exclude=.git/ git_dir work_dir
?
I just don't remember exactly how exclude is written. Like so.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question