I've been using this on and off for a while, but I'm not sure how I am supposed to get updates.
If I clone the repo it states that I should run the updateHostsFile.py script. So, I run it and it modifies the hosts file at the root of the repo, which does not allow me to pull new changes anymore:
$ git pull
error: Cannot pull with rebase: You have unstaged changes.
No matter, I can just checkout the hosts file and pull again.
$ git checkout hosts
However, when I start to add customizations to the myhosts file and the whitelist file, I run into the same problem.
$ git pull
error: Cannot pull with rebase: You have unstaged changes.
Now, I do not want to check out these files because I will lose my changes. So, my current workflow is something like:
myhostswhitelistgit checkout .myhosts from backupwhitelist from backupAnd of course, I have to go look up the all of the options and flags because I've forgotten them:
python updateHostsFile.py \
--replace \
--backup \
--noupdate \
--extensions gambling porn social
Please tell me there is a better way :)
Before you pull from this repo, execute this:
git reset --hard
Thereafter pulling will be fine.
The easiest way to keep local changes that I've found is:
git checkout -- hosts readmeData.json
git stash
git pull
git stash pop
That places the blacklist and myhosts file into a stash that you can pop after pulling the rest of the files down.
@meinhimmel and @jish I swear by the pull and push bash commands that come with git-friendly. These have git rebase baked-in and I can't overstate the usefulness of these two simple, elegant commands. The branch command in git-friendly is useful as well.
Edit: I just submitted git-friendly to Hacker News.
Closing.
Most helpful comment
The easiest way to keep local changes that I've found is:
That places the blacklist and myhosts file into a stash that you can pop after pulling the rest of the files down.