3

The following is the requirement:

  1. 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

  2. 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?

1 Answer 1

1

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 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.