Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SourceTree share folder index permission issue

hanoh haim July 3, 2015

ST version is 1.6.14.0. 

When  repo is on share NFS folder used by both linux and windows F5 from ST change .git/index to be 

with +x 

 

before

------------

[csi-kiwi-02]> ll -a .git
total 72K
drwxr-xr-x 8 hhaim eng 4.0K Jul 3 18:30 .
drwxr-xr-x 5 hhaim eng 8.0K Jul 3 17:35 ..
drwxr-xr-x 2 hhaim eng 4.0K Jul 1 12:47 branches
-rw-r--r-- 1 hhaim eng 5 Jul 3 17:50 COMMIT_EDITMSG
-rwxr-xr-x 1 hhaim eng 661 Jul 3 17:10 config
-rw-r--r-- 1 hhaim eng 73 Jul 1 12:47 description
-rwxr-xr-x 1 hhaim eng 316 Jul 3 18:27 FETCH_HEAD
-rw-r--r-- 1 hhaim eng 23 Jul 3 18:30 HEAD
drwxr-xr-x 2 hhaim eng 4.0K Jul 1 12:47 hooks
-rw-r--r-- 1 hhaim eng 5.5K Jul 3 18:30 index
drwxr-xr-x 2 hhaim eng 4.0K Jul 1 12:47 info
drwxr-xr-x 3 hhaim eng 4.0K Jul 1 12:47 logs
drwxr-xr-x 122 hhaim eng 12K Jul 3 17:33 objects
-rw-r--r-- 1 hhaim eng 41 Jul 3 17:07 ORIG_HEAD
-rw-r--r-- 1 hhaim eng 107 Jul 1 12:47 packed-refs
drwxr-xr-x 5 hhaim eng 4.0K Jul 1 12:47 refs
-rwxr-xr-x 1 hhaim eng 863 Jul 3 18:26 sourcetreeconfig
[csi-kiwi-02]>

 

 

after 

----------------------

 

[csi-kiwi-02]> ll -a .git
total 72K
drwxr-xr-x 8 hhaim eng 4.0K Jul 3 18:28 .
drwxr-xr-x 5 hhaim eng 8.0K Jul 3 17:35 ..
drwxr-xr-x 2 hhaim eng 4.0K Jul 1 12:47 branches
-rw-r--r-- 1 hhaim eng 5 Jul 3 17:50 COMMIT_EDITMSG
-rwxr-xr-x 1 hhaim eng 661 Jul 3 17:10 config
-rw-r--r-- 1 hhaim eng 73 Jul 1 12:47 description
-rwxr-xr-x 1 hhaim eng 316 Jul 3 18:27 FETCH_HEAD
-rw-r--r-- 1 hhaim eng 23 Jul 3 18:26 HEAD
drwxr-xr-x 2 hhaim eng 4.0K Jul 1 12:47 hooks
-rwxr-xr-x 1 hhaim eng 5.5K Jul 3 18:26 index       <<=========================
drwxr-xr-x 2 hhaim eng 4.0K Jul 1 12:47 info
drwxr-xr-x 3 hhaim eng 4.0K Jul 1 12:47 logs
drwxr-xr-x 122 hhaim eng 12K Jul 3 17:33 objects
-rw-r--r-- 1 hhaim eng 41 Jul 3 17:07 ORIG_HEAD
-rw-r--r-- 1 hhaim eng 107 Jul 1 12:47 packed-refs
drwxr-xr-x 5 hhaim eng 4.0K Jul 1 12:47 refs
-rwxr-xr-x 1 hhaim eng 863 Jul 3 18:26 sourcetreeconfig

 

 

 

now this create this issue from Linux

 

#>git checkout master

error: Unable to create .git/HEAD  

Already on 'master'

so it seem ST write this file and Linux having trouble to work with it ..

 

thanks

Hanoh

 

3 answers

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2015

You should not use a Git repository over NFS. If your repository is on a remote server, you should clone it to your local machine, and push and pull from there.

hanoh haim July 6, 2015

Hi Seth, fast for the fast response. The all point is to use SourceTree on my local repo (merge/diff/tree view/commit etc) SourceTree support looking into remote repo (push/pull) my local is on NFS because I need to edit from windows and compile from Linux. Is there a way to work on local repo while both Linux and Windows can work as git clients without interfering etch other? git client on linux can work on NFS share folder it it is the only client. SourceTree can work on NFS share folder if it is the only client . both does not work ..

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2015

I would only use one of the clients. Since you are sharing over NFS, operations in one environment will effect the repository in both. I would recommend using the Windows local drive as the physical home for the repo, and only use the SourceTree client. Share your repo over NFS, but don't use a Linux git client, just the compile process. That recommendation won't be sufficient if the compile process issues git commands.

0 votes
hanoh haim July 3, 2015

This is strace when it works rename(".git/index.lock", ".git/index") = 0 lstat(".git/HEAD", {st_mode=S_IFREG|0644, st_size=23, ...}) = 0 open(".git/HEAD", O_RDONLY) = 3 read(3, "ref: refs/heads/master\n", 255) = 23 read(3, "", 232) = 0 close(3) = 0 lstat(".git/refs/heads/master", {st_mode=S_IFREG|0755, st_size=41, ...}) = 0 open(".git/refs/heads/master", O_RDONLY) = 3 read(3, "eba24acea45f09269b616b14b3d27bb5"..., 255) = 41 read(3, "", 214) = 0 close(3) = 0 stat(".git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open(".git/HEAD.lock", O_WRONLY|O_CREAT|O_EXCL, 0666) = 3 write(3, "ref: refs/heads/master\n", 23) = 23 close(3) = 0 rename(".git/HEAD.lock", ".git/HEAD") = 0 lstat(".git/refs/heads/master", {st_mode=S_IFREG|0755, st_size=41, ...}) = 0 open(".git/refs/heads/master", O_RDONLY) = 3 read(3, "eba24acea45f09269b616b14b3d27bb5"..., 255) = 41 read(3, "", 214) = 0 close(3) = 0 stat(".git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 stat(".git/logs", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open(".git/logs/HEAD", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3 close(3) = 0 open(".git/logs/HEAD", O_WRONLY|O_APPEND) = 3 open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 4 fstat(4, {st_mode=S_IFREG|0644, st_size=9251, ...}) = 0 fstat(4, {st_mode=S_IFREG|0644, st_size=9251, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb964744000 read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0\0\0\0"..., 4096) = 4096 lseek(4, -3285, SEEK_CUR) = 811 read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0\0\0\0"..., 4096) = 4096 read(4, "\325\304\257\360\0\0\0\1\326\250\321\200\0\0\0\1\327\255\314p\0\0\0\1\330\210\263\200\0\0\0\1"..., 4096) = 4096 read(4, "\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2"..., 4096) = 248 lseek(4, 9250, SEEK_SET) = 9250 close(4) = 0 munmap(0x7fb964744000, 4096) = 0 write(3, "eba24acea45f09269b616b14b3d27bb5"..., 167) = 167

0 votes
hanoh haim July 3, 2015

fstat(3, {st_mode=S_IFREG|0644, st_size=5608, ...}) = 0 close(3) = 0 rename(".git/index.lock", ".git/index") = 0 lstat(".git/HEAD", {st_mode=S_IFREG|0644, st_size=23, ...}) = 0 open(".git/HEAD", O_RDONLY) = 3 read(3, "ref: refs/heads/master\n", 255) = 23 read(3, "", 232) = 0 close(3) = 0 lstat(".git/refs/heads/master", {st_mode=S_IFREG|0755, st_size=41, ...}) = 0 open(".git/refs/heads/master", O_RDONLY) = 3 read(3, "eba24acea45f09269b616b14b3d27bb5"..., 255) = 41 read(3, "", 214) = 0 close(3) = 0 stat(".git", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open(".git/HEAD.lock", O_WRONLY|O_CREAT|O_EXCL, 0666) = 3 write(3, "ref: refs/heads/master\n", 23) = 23 close(3) = 0 rename(".git/HEAD.lock", ".git/HEAD") = -1 EACCES (Permission denied) write(2, "error: Unable to create .git/HEA"..., 34error: Unable to create .git/HEAD strace from linux shows that there is lock file issue

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events