Preventing a file overwrite with Git
my company started recently to use Git for source version control, and due to the incompetence of the coders - that's me and my boss :-P - we have a really nice spaghetti of files being overwritten here and there. Is there a way to mark certain files as 'untouchable' so if when updating a branch from another either do(es)n't overwrite the file(s) or doesn't do the update at all? Thanks in advance.
You can do exactly what you're asking for with hooks, but I don't know if that solves your real problem.
If it's as simple as your in-progress files getting munged, that's easy: Never pull/merge/rebase with uncommitted changes. Always commit before bringing in any other code.
You can add a file named .gitignore. Any filename that matches a regular expression in that file will be ignored by git.
So, I usually start with something like:
*.log *~ conf/*
Modify to taste.