Original README.md in master is gone after running this hook
Opened this issue · 0 comments
First of all: thanks for this, it is saving me a lot of time. There is some odd behaviour that I have noticed, however: when the script is running on the "gh-pages" branch, it removes the README.md checked out from "master"; when I am returned to "master" at the end, I find that git is saying that README.md was deleted from the "master" branch.
This makes little sense to me, as it's clearly only removing README when on the "gh-pages" branch. I am assuming that, somehow, the behaviour of git's checkout command may've changed in the last few years since you wrote this, but so far have been unable to get to the bottom of it.
I also wondered if it was because of the use of the -a
flag in the git commit
command, but I have discounted this on the grounds that, even when no commit is made to "gh-pages" because there were no changes this time 'round, I still find "README.md" has been deleted after the script was run.
I'm actually using slightly different code to yours (though the only difference is the use of tail as part of the cat) - I'll try to come up with a minimal example if this is not something you have already encountered and know the answer for already.