Colon in a git file name. Windows developers alarm?

Yesterday a coworker running Linux on his laptop pushed to our master a set of files with a colon : in their names.

This is a legal file name in Unix world, but others running Windows could not pull anymore. Eclipse cancels the pull as the file name is valid. Git from console pulls the repository but does not allocate those files because of their illegal file name, so I end up with a working copy with missing files.

  • Git diff fails on file with underscore in path
  • Git character encoding with Spanish characters
  • Delete a file from a Git repo with an apostrophe or quote in the name
  • How to apply a Git patch to a file with a different name and path?
  • Git wrongly interprets that files names have changed after I pull
  • Git pull error: unable to create file (Invalid argument)
  • Before answering “switch to Linux” or “Linux is better than…” please understand that this is indeed an error as our software is normally deployed to both Windows and Linux servers, so including an illegally named file in a war package will result in a crash.

    Here are my questions:

    • Is it possible in Git to restrict file naming? For example, SVN warns the committer when two files with different casing coexist or a file is renamed in its casing (e.g. Myclass.cs to MyClass.cs). I would like to enforce Windows-style names in files, as Windows is strictly more restrictive than Unix. I don’t know about any legal file name that is illegal in Unix world
    • Is it dangerous to keep such commit in history? I have successfully asked the committer to revert his change, reset my working copy to a few revisions before that guilty commit, and then pulled. However nobody using Windows will ever be able to pull that revision (not a problem) or probably rebase it interactively in a branch

    Yes, I understand it was a mistake to let him push directly to master, as we could easily isolate and obliterate che change if it was in a branch.

    Since we have a bunch of active branches that are behind the master and need to be merge-aligned before PR, and need to be merged, I am wondering if it could be a good idea to rebase the master onto itself, force push and let all developers learn their lessons.

    As final note, we use Bitbucket Server running on a Linux host and can perform merging using pull requests

  • Git hook that emails several people when a new tag is created
  • Git: how to ignore hidden directories?
  • Why should I put files inside .idea folder under version control?
  • Get %AppData% path (or other environment variable) for Git hook on Windows (10)
  • Git v1.8 backwards compatibility with Git v1.7
  • Swift: Type 'ViewController' does not conform to protocol 'UIPageViewControllerDataSource'
  • One Solution collect form web for “Colon in a git file name. Windows developers alarm?”

    You could install some git hooks (doing appropriate checks), notably a git precommit hook (at least for Linux users), or a prepush hook.

    Of course, that requires some cooperation (and convincing people to use it).

    Git Baby is a git and github fan, let's start git clone.