0

Assuming there's a Git repository hosted on a Linux machine and there are developers using both Windows and Linux, is there a way to prevent Linux developers from committing files with same names but different cases?

I think I've to write a server-side hook for this, but I don't know how to validate the names of incoming files inside the hook script.

Any help/references related to this would be appreciated.

Alireza
  • 100,211
  • 27
  • 269
  • 172
JSN
  • 2,035
  • 13
  • 27
  • Check out this answer: https://stackoverflow.com/a/17688308/2872038 – Joshua Jones Jul 04 '17 at 14:42
  • The problem is bigger than mere case-folding issues. For instance, a Linux user can create a file named `CON:` and store it in the repository, and Windows cannot handle that. Mac users sometimes store files with invalid-in-Windows characters in their names. Doing a really proper job of this is very difficult. But, if you just want to check case-folded names, consider using `git ls-tree -r` and piping it through `tr` in your script (assuming you are writing in shell). – torek Jul 04 '17 at 15:42

1 Answers1

0

If you want keep some files locally then git stash is your friend. stash usage

al3xkr
  • 46
  • 8