Hacker News new | ask | show | jobs
by darrickwiebe 4815 days ago
This command has a mistake in it:

  ours   = "!f() { git commit --ours $@ && git add $@; }; f"
it should be

  ours   = "!f() { git checkout --ours $@ && git add $@; }; f"
3 comments

Thanks, I've used an alias for checkout, "co", which I wrongly expanded when I wrote up the article. I've corrected it. Proofreading is another way not to get fired.
Has anyone ever gotten fired for making a git or other version control "mistake?"

https://news.ycombinator.com/item?id=5513353

Most certainly. I've witnessed it. It was a really bad mistake though.
Looks like your probation period is over.
Shouldn't the $@ also be quoted? If one of the argument is a quoted file path with a space, the unquoted form is going to see multiple paths.
Also note that the 'git add' here is actually completely redundant - 'git checkout <filename>' automatically updates the index with the checked-out version of the file, in addition to the working tree.