comment ignorer les fichiers après la validation dans git post-réception?

StackOverflow https://stackoverflow.com/questions/9384921

  •  28-10-2019
  •  | 
  •  

Question

J'ai un projet intermédiaire: un tas de fichiers de configuration, un répertoire source et un répertoire de construction, comme ceci:

project/
  build/
   index.html
  source/
   _index.haml
 config.rb
 Gemfile
 WhatNot

Sur mon serveur, j'ai une racine http, disons / var / www / html / project /.

Je gère donc un dépôt git sur /var/www/html/project.git/

Il y a un /var/www/html/project.git/hooks/post-receive qui dit:

GIT_WORK_TREE=/var/www/html/project git checkout -f

Ainsi, lorsque je pousse, les fichiers sont copiés vers la racine http.Mais seul le répertoire de construction est pertinent.Je ne veux pas que config.rb, ou le répertoire source, soit copié dans la racine http;Comment puis-je dire à git d'ignorer certains fichiers pendant l'exécution du hook post-receive?

Était-ce utile?

La solution

Donnez simplement le chemin à extraire:

git checkout -f -- build
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top