An excerpt from the repository, fetched Nov 13, 2026.
Read the project’s introduction
drive
drive is a tiny program to pull or push Google Drive files.
drive was originally developed by Burcu Dogan while working on the Google Drive team. Since she is very busy and no longer able to maintain it, I took over drive on Thursday, 1st January 2015. This repository contains the latest version of the code.
Table of Contents
Installing
Requirements
From sources
Godep
Platform Packages
Automation Scripts
Cross Compilation
API keys
Usage
Hyphens: - vs --
Initializing
De Initializing
Traversal Depth
Configuring General Settings
Excluding And Including Objects
Sample .driveignore with the exclude and include clauses combined
Pulling
Verifying Checksums
Exporting Docs
Pushing
Pulling And Pushing Notes
End to End Encryption
Publishing
Unpublishing
Sharing and Emailing
Unsharing
Starring Or Unstarring
Diffing
Touching
Trashing And Untrashing
Emptying The Trash
Deleting
Listing
Stating
Printing URL
Editing Description
Retrieving MD5 Checksums
Retrieving FileId
Retrieving Quota
Retrieving Features
Creating
Opening
Copying
Moving
Renaming
Command Aliases
Detecting And Fixing Clashes
.desktop Files
Fetching And Pruning Missing Index Files
Drive Server
QR Code Share
About
Help
Filing Issues
Revoking Account Access
Uninstalling
Applying Patches
Why Another Google Drive Client?
Known Issues
Reaching Out
Disclaimer
LICENSE
Installing
Requirements
go 1.9.X or higher is required. See here for installation instructions and platform installers.
Make sure to set your GOPATH in your env, .bashrc or .bash_profile file. If you have not yet set it, you can do so like this:
cat << ! >> ~/.bashrc
> export GOPATH=\$HOME/gopath
> export PATH=\$GOPATH:\$GOPATH/bin:\$PATH
> !
source ~/.bashrc # To reload the settings and get the newly set ones # Or open a fresh terminal
The above setup will ensure that the drive binary after compilation can be invoked from your current path.
From sources
To install from the latest source, run:
go get -u github.com/odeke-em/drive/cmd/drive
Otherwise:
In order to address issue #138, where debug information should be bundled with the binary, you'll need to run:
go get github.com/odeke-em/drive/drive-gen && drive-gen
In case you need a specific binary e.g for Debian folks issue #271 and issue 277
go get -u github.com/odeke-em/drive/drive-google
That should produce a binary drive-google
OR
To bundle debug information with the binary, you can run:
go get -u github.com/odeke-em/drive/drive-gen && drive-gen drive-google
Godep
Using godep
cd $GOPATH/src/github.com/odeke-em/drive/drive-gen && godep save
Unravelling/Restoring dependencies
cd $GOPATH/src/github.com/odeke-em/drive/drive-gen && godep restore
Please see file drive-gen/README.md for more information.
Platform Packages
For packages on your favorite platform, please see file Platform Packages.md.
Is your platform missing a package? Feel free to prepare / contribute an installation package and then submit a PR to add it in.
Automation Scripts
You can install scripts for automating major drive commands and syncing from drive-google wiki, also described in platform_packages.md.
Some screenshots are available here.
Cross Compilation
See file Makefile which currently supports cross compilation. Just run make and then inspect the binaries in directory bin.
Supported platforms to cross compile to:
ARMv5.
ARMv6.
ARMv7.
ARMv8.
Darwin (OS X).
Linux.
Also inspect file bin/md5Sums.txt after the cross compilation.
API keys
Optionally set the GOOGLE_API_CLIENT_ID and GOOGLE_API_CLIENT_SECRET environment variables to use your own API keys.
Usage
Hyphens: - vs --
A single hyphen - can be used to specify options. However two hyphens -- can be used with any options in the provided examples below.
Initializing
Before you can use drive, you'll need to mount your Google Drive directory on your local file system:
OAuth2.0 credentials
drive init ~/gdrive
cd ~/gdrive
Google Service Account credentials
drive init --service-account-file <gsa_json_file_path> ~/gdrive
cd ~/gdrive
Where <gsa_json_file_path> must be a Google Service Account credentials file in JSON form.
This feature was implemented as requested by:
#879
De Initializing
The opposite of drive init, it will remove your credentials locally as well as configuration associated files.
drive deinit [-no-prompt]
For a complete deinitialization, don't forget to revoke account access, please see revoking account access
Traversal Depth
Before talking about the features of drive, it is useful to know about "Traversal Depth".
Throughout this README the usage of the term "Traversal Depth" refers to the number of
nodes/hops/items that it takes to get from one parent to children. In the options that allow it, you'll have a flag option -depth <n> where n is an integer
Traversal terminates on encountering a zero 0 traversal depth.
A negative depth indicates infinity, so traverse as deep as you can.
A positive depth helps control the reach.
Given:
|- A/
|- B/
|- C/
|- C1
|- C2
|- C10/
|- CTX/
| - Music
| - Summary.txt
Items on the first level relative to A/ ie depth 1, we'll have:
B, C
On the third level relative to C/ ie depth 3
We'll have:
Items: Music, Summary.txt
The items encountered in depth 3 traversal relative to C/ are:
|- C1
|- C2
|- C10/
|- CTX/
| - Music
| - Summary.txt
No items are within the reach of depth -1 relative to B/ since B/ has no children.
Items within the reach of depth - relative to CTX/ are:
| - Music
| - Summary.txt
Configuring General Settings
drive supports resource configuration files (.driverc) that you can place both globally (in your home directory)
and locally(in the mounted drive dir) or in the directory that you are running an operation from, relative to the root.
The entries for a .driverc file is in the form a key-value pair where the key is any of the arguments that you'd get
from running
drive <command> -h
# e.g
drive push -h
and the value is the argument that yo
Read the full README on GitHub