1
  1. Team Lead Created A repository
  2. Pushed Two files with permission 655 and 755 respectively.
  3. Clone the repository by another team member A by terminal.
  4. Trying to edit the file in sublime text and its showing permission denied message upon saving.
  5. gave 777 permission to folder with recursive mode and finish the editing
  6. Push the changes by team member A and completes
  7. Team Lead pull the changes via terminal,got the latest file and again changed the permission to 755.
  8. Only work on file after making the permission to 777.

Why this happening like this in ubuntu ? The permission switching is making problems for me.. Any Idea for recovering this issue ?

3
  • Why aren't you the owner of the files?
    – Ry-
    Commented Jul 19, 2016 at 3:51
  • How can I own the file... ? I run the sudo su in terminal before doing this thing...
    – Jishad P
    Commented Jul 19, 2016 at 3:52
  • Don't clone things as root?
    – Ry-
    Commented Jul 19, 2016 at 4:31

1 Answer 1

5

Git actually doesn't keep track of permissions set on files except for the executable bit.

Since you cloned the repo as root, then root is the owner and the only one that can edit the files.

Change ownership to your username

chown -R <username> <project_directory>/
1
  • @JishadP: No, just once.
    – Ry-
    Commented Jul 19, 2016 at 4:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.