PIP — Install Specific Commit from Git Repository

I’ve switched to an all PIP deployment setup. I used to keep some libraries in my code repository because I needed specific versions or hacked ones.

I’m now in a setup where I don’t have any hacked libraries, so all is good, except I need a dev version of django-mailer that’s not on PIP.

PIP can handle git repos, but what if an unstable change gets introduced?

Well, until now, I didn’t know you could specify a commit hash in your pip install command.

Specify the hash tag with @, and use git:// syntax, not the default https: that the clone bar shows you.

# requirements.txt
git+git://github.com/jtauber/django-mailer.git@840d25bb9db9fbc801b9

# shell
bash $ pip install -r requirements.txt

2 Comments

  1. Zenobius says:

    Does this work for tags as well ? I want to make sure i grab the haystack tagged with 1.2.4

    1. Zenobius says:

      apparently it does.

Leave a reply to Zenobius Cancel reply