Wednesday 5 April 2017

To prevent pushing the file permission in local into git repo (MacOS)

After switching to MacOS, I had to change the my applications's files permissions due to MAC permissions issue to run the application.

Afterwards, I made a commit and pushed to the Git Repo, however the modified file's permission also included on the push to the Git Repo.

Indeed, I do not want to include those permission which I have done for my local only and I have to reset my commit on the remote repo.

To prevent happening that, please follow the steps below:

1. Check the filemode status on git config:
$ git config -l

Output may contain below:
$ core.filemode=true

2. If it set as true, run the below command to set to false which will prevent including the file permission on the commits.
$ git config core.filemode false

3. Instead, run below command if you want to change the git configuration globally to apply on all the applications:
$ git config --global core.filemode false

No comments:

Post a Comment

Please post any queries and comments here.