The following is the requirement:
Create a file test.sql , set the permissions to –rwxr-xr-- i.e here the owner and groups has executable. Let's say the file is pushed to source control
When I want to download the file back from source control the permissions should be retained as it is - –rwxr-xr--.
With Git when I pull the file from repository I see the permissions –rwxr-xr-x i.e the others have executable permissions which I wouldn't require.
The permissions should also be retained in development.
Could you please let me know how to retain the permissions when archiving.
I saw several answers in the forum but I couldn't get which one should be implemented,
git hooks? scripts?
You can use this gist.
You store the permissions of your files and directories in a separate file named .git_cache_meta and no directly under git.
A full sample can be found here
Copied form the above post:
+# git bundle create mybundle.bdl master; git-cache-meta --store
+# scp mybundle.bdl .git_cache_meta machine2: #then on machine2:
+# git init; git pull mybundle.bdl master; git-cache-meta --apply
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With