Monday, September 5, 2022
HomeWordPress DevelopmentThe way to make Git ignore file permission (chmod) adjustments

The way to make Git ignore file permission (chmod) adjustments


Have you ever ever made some adjustments in git, after which modified the information permissions too, solely to understand you solely wish to publish the adjustments to the information, and never the file permissions? Or possibly you’ve got up to date the file permissions on a bunch of information, which you don’t want to publish to your repository. This will occur should you replace a file’s chmod or file permissions.

By default, should you do a git push or a git commit on these information, the file permissions shall be uploaded too. Information which have restricted file permissions, will nonetheless have them when they’re pulled from the repo.

That may be positive if you’d like a file’s permissions to be revealed, however generally you solely wish to commit the content material, and never the adjustments in file permission. If you wish to ignore file permissions, then you may run the next command in git:

git config core.fileMode false
Enter fullscreen mode

Exit fullscreen mode

This can replace the the git configuration for this repository to utterly ignore file permission adjustments when doing a commit and push. Be aware, you may solely swap this on or off for all information. To alter it again to the default setting, in order that file permissions shall be dedicated and pushed to your repositories, you may run the command once more with a worth of true:

git config core.fileMode true
Enter fullscreen mode

Exit fullscreen mode

Be aware: watch out when utilizing this. Though helpful, be sure you set it again to true, in order that you do not have an effect on the longer term growth of your repository in a adverse means.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments