01VCS / git-meta

Wanna git preserve your file dates? git-meta stores all files' metadata into .gitmeta! On every commit!
12 stars 3 forks source link

Help: Beginner, Windows keep date modified and date created #10

Closed coolpben closed 1 year ago

coolpben commented 1 year ago

Hello,

I don't know this is the right place to ask but i got the following situation:

I use git-bash.exe on my windows. I have a gitlab self-hosted server. I have a repository and did the following things:

  1. Git clone
  2. Modified files
  3. Copied init.sh and git-meta and executed the init.sh
  4. git add . git commit -m "message" and saw that it uses git-meta made a .gitmeta and lastly did git push Everything worked so far...

But when someone else made a git clone with git-bash.exe they have no .git/hooks/git-meta and also the files were not the same with date modfied and date created. I think I need to do something with the git-meta to stay in .git/hooks but i don't how i can manage it.

What I have in mind is when someone commits it automatically is set in the .gitmeta and when someone is git cloning or git pulling it automatic do a git-meta --apply.

Is this possible and how can i do this in combination with your git-meta script?

coolpben commented 1 year ago
  1. Manually added the git-meta to the git-bash.exe in C:\Program files\Git alike is described in install.sh.
  2. made global hooksfolder git config --global core.hooksPath 'C:\hooks' (as example)
  3. Made two hooks post-checkout and pre-commit.
  4. In post-checkout (if statement if .gitmeta not exist make it with git-meta --store, otherwise do git-meta --apply.
  5. In post-commit git-meta --store

With the hooks it always uses the .gitmeta to change the 'date Modified' and 'Date Created'.

I also changed the git-meta, because I always want to get metadata of all the files and I deleted the print chown and chmod, because it is necessary for me.