u" /> u" /> u"/>

Why does git checkout change mode of untracked files to read only?

139 views Asked by At

And more importantly, how can this be prevented?

echo tracked > tracked.txt
git add tracked.txt
git commit tracked.txt -m "tracked"
echo untracked > untracked.txt
ls -l  

total 2
-r--r--r-- 1 My Name 1049089 8 Dec 2 09:17 tracked.txt
-rw-r--r-- 1 My Name 1049089 10 Dec 2 09:18 untracked.txt

git checkout master -- tracked.txt
ls -l

total 2
-r--r--r-- 1 My Name 1049089 8 Dec 2 09:17 tracked.txt
-r--r--r-- 1 My Name 1049089 10 Dec 2 09:18 untracked.txt

config
    [core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true

.gitattributes
    * filter=lfs diff=lfs merge=lfs -text lockable
    .gitattributes -filter -diff -merge -text
    .gitattributes export-ignore
    README.md export-ignore
0

There are 0 answers