Sometimes, You all may have a situation to push files to git repositories which does not have a common directory. For example , take a case in linux. you need to push asterisk files to git repository as backup. But asterisk files are situated in different directories. Such as ,
In this case , there is no common directory.
To push this , you need to bring or direct contents of this folders to a common folder. For this symbolik link cannot be used.
So next way is to mount these files to a directory.
General Syntax is :
sudo mount --bind SOURCEDIRECTORY TARGETDIRECTORY
For above example ,
create a directory named GIT_PUSH in /var/www/html/
Now mount the files to this folder by ,
sudo mount --bind /etc/asterisk/ /var/www/html/GIT_PUSH/
sudo mount --bind /var/lib/asterisk/ /var/www/html/GIT_PUSH/
sudo mount --bind /var/spool/asterisk/ /var/www/html/GIT_PUSH/
sudo mount --bind /var/log/asterisk/ /var/www/html/GIT_PUSH/
Now all files will be available in this directory. Now you can init git repo here.