Search code examples
gitreact-nativefile-permissions

My src folder locked with only read permission in react-native project


I am developing the app in react-native and my code committed on git server but I am facing one strange issue.

Every time while I get to pull from git it will lock my src folder with read-only permission in my project and I cant able to modify that code and every time I need to provide read-write access from finder.

Note: This issue is only for MAC OS while the same thing will not happen on Windows machine.

To provide permission every time will be delaying my tasks.

Anyone facing the same issue of read-only permission in all scr & its subsidiary files.

Check attached screenshot for more detail.

Failed to save 'DashboardScreen.js': A system error occurred (EACCES: permission denied, open '/Volumes/DATA/myapp/code//src/components/dashboard/DashboardScreen.js')

enter image description here

Thanks in advance!


Solution

  • I face this issue in Linux, I solved it by applying all permissions to the project folder and all its descendant.

    sudo chmod -R 7777 <project_folder_name>
    

    OR

    In the file .git/config, I added a line that read: sharedRepository = group, like so:

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
            sharedRepository = group