Skip to content
This repository has been archived by the owner. It is now read-only.
Create a git repository from the revision history of a document in Google Drive.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Synopsis [-h] [--config CONFIG] [--text] [--html] docid


  • --config CONFIG, -f CONFIG -- path to configuration file
  • --text, -T -- fetch plain text content (Look out for BOM)
  • --html, -H -- fetch HTML content
  • --mime-type -- specify arbitrary mime type

Example usage:

$ python 1j6Ygv0_this_is_a_fake_document_id_a8Q66mvt4
Create repository "Untitled"
Initialized empty Git repository in /home/lars/projects/gitdriver/Untitled/.git/
[master (root-commit) 27baec9] revision from 2013-01-08T21:57:38.837Z
 1 file changed, 1 insertion(+)
 create mode 100644 content
[master 132175a] revision from 2013-01-08T21:57:45.800Z
 1 file changed, 1 insertion(+), 1 deletion(-)
[master eb2302c] revision from 2013-01-09T01:47:29.593Z
 1 file changed, 5 insertions(+), 1 deletion(-)
$ ls Untiled
$ cd Untitled
$ git log --oneline
d41ad6e revision from 2013-01-09T01:47:29.593Z
8d3e3ec revision from 2013-01-08T21:57:45.800Z
ccc0bdd revision from 2013-01-08T21:57:38.837Z

Google setup

You will need to create an OAuth client id and secret for use with this application, the Drive API Python quickstart has links to the necessary steps.


In order to make this go you will need to create file named gd.conf where the code can find it (typically the directory in which you're running the code, but you can also use the -f command line option to specify an alternate location).

The file is a simple YAML document that should look like this:

  client id: YOUR_CLIENT_ID
  client secret: YOUR_CLIENT_SECRET

Where YOUR_CLIENT_ID and YOUR_CLIENT_SECRET are replaced with the appropriate values from Google that you established in the previous step.

You can’t perform that action at this time.