0

I created a new repository on my production server and synced it to my dev server and local server.

Cloning it to my dev and local machines worked well, But the files and directories permissions didn't work properly.

This is how I uploaded my files to the git repository:

Get files from the machine => to the repo:

  1. cd to projects dir. Make sure your user has permission (sudo chown me: /var/www/atestproject)
  2. Initializing a git repo: git init
  3. Add files: git add .
  4. Commit the changes: git commit -m "Initial-Commit"
  5. Add to git repo to account: git remote add origin git@bitbucket.org:potato666/opti.git
  6. git fetch
  7. git pull origin master
  8. git push

and i cloned the files to my local machine by cd-ing to a folder and then git clone git@bitbucket.org:potato666/opti.git . where all file/dorectory users owners and access permissions are not set line the one on production.

Christos Batzilis
  • 352
  • 1
  • 3
  • 12
Imnotapotato
  • 5,308
  • 13
  • 80
  • 147
  • Possible duplicate of [Git is changing my file's permissions when I push to server](https://stackoverflow.com/questions/11230171/git-is-changing-my-files-permissions-when-i-push-to-server) – phd Jun 03 '18 at 19:37
  • https://stackoverflow.com/questions/2342432/git-hooks-for-metadata-storage-retrieval – phd Jun 03 '18 at 19:37

1 Answers1

2

Git itself does store only owner-executable permission & symlinks. So no way to do it with git. What you can still do is use 3rd party tools like git-cache-meta.

Ross
  • 1,641
  • 3
  • 15
  • 16