bash - Copy files from mounted volume git pre-commit -


is possible use git pre-commit hooks copy files mounted volume repo contents of volume can committed rest of repo?

if so, script like?

if want bring whole mounted folder repo each time:

#!/bin/bash  cp -r mountdir .; git add mountdir; 

if want copy out contents of mounted folder git repo every time:

#!/bin/bash  mntdir="/home/tyssen/mounted"  f in `ls $mntdir`;     cp -r $mntdir/$f .     git add $f; done 

note dreaded parsing of ls, better me globs or find can improve upon. tested , working me on local repo.

to copy in previous example, path inside repo (untested):

#!/bin/bash  mntdir="/home/tyssen/mounted"  f in `ls $mntdir`;     cp -r $mntdir/$f path/in/repo/     git add path/in/repo/$f; done 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -