12

With git and hg, etc, you can define .gitignore file that will prevent certain folders/filetypes from being saved to the repo.

Is there anything of that nature for Google Drive? In the preferences, I see I can select a parent folder to not be synced, but I see nothing along the lines of subfolders.

Env is OS X...

2

The way I deal with this is to:

  1. Disable starting GoogleDrive on system startup
  2. Create a bash script to clear temporary and log files first, and then run google drive
  3. Schedule that script to start on system boot

I know its far from perfect, but its something.

| improve this answer | |
  • 1
    I like it. It's not so far from perfect. – Sam Hammamy Dec 6 '14 at 23:10
  • Unfortunately, it's one of the better solutions I've seen since Google has yet to implement a feature that allows us to exclude particular filetypes, etc. My copy of Adobe InDesign will only allow me to save a file once because the .idlk file (lock file) becomes perpetually stuck trying to upload in Google Drive sync. – armadadrive Oct 1 '15 at 13:51
  • 2
    Not quite a solution. For developers, those "unwanting to sync" files are actually required for development. Like node_modules, .git files, and many others – Elton Jain Feb 8 '17 at 7:19
  • @EltonJain But still, IDEs like PHPStorm generate thousands of little files for each new project which, or even cache those settings ... all of this nonesense belongs in the local – samayo Feb 24 '17 at 13:35
1

Symbolic links could be used in this case. Google Drive doesn't seem to detect symbolic links, so you can put your node_modules somewhere outside the Drive, then inside the drive create a symbolic link to node_modules.

Example structure:

google_drive
    my_app
        package.json      file
        app.js            file
        my_apps_stuff     folder
        node_modules      symbolic link ==> /home/me/gdrive_ignored/my_app/node_modules

Linux, Windows, and OSX all have symbolic links.

If you run into issues with your application not working with symbolic links, then create a hard link.

| improve this answer | |
  • This seems like a better solution. What about when you deploy that file, you have to do npm install again right? – samayo Jul 9 '19 at 17:56
  • Yes. The modules should not be bundled with the software when deploying. – Jack Cole Jul 9 '19 at 18:57
1

For Windows, I use a simple Powershell script that relocates the desired folders (node_modules) to a different location outside Google Drive, and replaces them with Symbolic links so everything keeps working.

It can be found in this repo, along with the instructions to set it up.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.