Trying to link to a Git repo on NAS folder, where I have no authority to run a Git server.
first, init a bare Git repo on server,
for windows, there's no problem that a can mount the folder on NAS and clone the Git repo. (need some Git config tweak to push)
But I encounter a problem that I can't directly write to the path where I mount the smb:\\ on Ubuntu, which make Git clone failed.
here's how I solves it
install cifs-utils
$ sudo apt install cifs-utils $ sudo mount.cifs //$IP/$Resource /mnt/samba -o user=$username,domain=$domainName
you can use smbclient to check samba connection and resource first
$ sudo apt install smbclient $ sudo smbclient -L $IP -W $domainName -U $userName
在ubuntu上git push到NAS上的資料夾會因為權限問題push不上去
嘗試著用 chmod 更改權限失敗
目前work around 是用
$ sudo git push
去push,之後可以參考https://www.itread01.com/content/1524633739.html
在掛載時加入dir_mode=0777,file_mode=0777設定權限
沒有留言:
張貼留言