You need to be careful with the find
command inside a git project.
Imagine you need to change a URL.
1 | [mburke]$ ack "/resources/" |
Hey, only three! Now craft a nice find replace with sed
.
1 | [mburke]$ find . -type f -exec sed -i '/\\/resources\\//\\/blog\\//gi' {} \; |
Oops.
ack
has the nice behavior of ignoring the .git/
directory. find .
is not so helpful.
You’ve just clobbered over some commit objects in the git database. By changing their content, you’ve change the hash checksums, and git reports an error for just about every command.
Luckily, in my case, I was all pushed up and could just re-clone the repository. If this happens to you and you have un-pushed changes, its going to take a good bit of git spelunking to get back to a stable state.
Be careful out there.