Django Etag doesn’t work on my local machine via the virtual webserver.
The reason is that browser sends a request via HTTP/1.1 and django sends a response via HTTP/1.0.
How I can update the version on my machine? Here’s a monkey patch that tweak the version number.
Do not use it on your web server if you use a web webserver such as apache or nginx.
# HACK: without HTTP/1.1, Chrome ignores certain cache headers during development!
# see http://stackoverflow.com/a/28033770/179583 for a bit more discussion.
from wsgiref import simple_server
simple_server.ServerHandler.http_version = "1.1"
I found this monkey patch from stackoverflow.com but unfortunately I lost the link. 😦
Git 2.0 the default behavior will be to only push the current branch checked out. The option is currently a setting called simple for option push.default.
So you can set this new (in my opinion better) default behavior right now.
$ git config --global push.default simple
and that’s it. Just in case you want to use that. The old default, that pushed everything at once just in case you want to go back was matching, instead of simple.
For a specific file use:
$ git checkout path/to/file/to/revert
For all unstaged files use:
$ git checkout -- .
Don’t forget to add ‘.’ at the end.
If you want to list all files for a specific branch, e.g. master:
$ git ls-tree -r master --name-only
-d Show only the named tree entry itself, not its children.
-r Recurse into sub-trees.
You can specify HEAD instead of master to get the list for any other branch you might be in.
If you want to get a list of all files that ever existed:
$ git log --pretty=format: --name-only --diff-filter=A | sort -
There’s a simple reference to get started using git.
~/myproject $ git init
~/myproject $ git add .
~/myproject $ git commit -m "first commit"
~/myproject $ cd ~/Dropbox/git
~/Dropbox/git $ git init --bare myproject.git
~/Dropbox/git $ cd ~/myproject
~/myproject $ git remote add origin ~/Dropbox/git/myproject.git
~/myproject $ git push -u origin master