-
Notifications
You must be signed in to change notification settings - Fork 506
git push -r moves all the older files of a drive into 'trash' #49
Comments
Too bad to hear about that. Just a quick tip, probably do a drive pull on first init to get your content registered locally just in case you want to push later. Otherwise, 'push'-ing requests that your Google drive be mirrored to the local drive directory. The absence of a file locally during a push is telling drive to delete it if present upstream. |
Just discovered this too. Wasn't using the recursive option and it still removed files in the destination. At the moment, it seems quite dangerous using push or pull on a whole folder. |
Hey folks, I have started a wiki at https://github.com/rakyll/drive/wiki to hopefully address such issues and help users understand the usage and behaviour of drive, as well as answer some commonly raised issues/questions. For now it is a rough wiki but will be updating it over the course of the week. |
Thanks for putting up the wiki. It doesn't quite go far enough in explaining that files will be deleted in the destination. I think it covers the simple use case quite well, where we do an initial pull and then follow it up with a push or pull to sync additional content. I think one of the issues is that using verbs like push and pull one expects it to behave a bit more like git or even rsync but it's behaviour is quite different. For example, if I do an initial pull and then add a local file (testlocal.txt) and then a colleague adds a file to the same folder (testremote.txt) I am stuck. If I pull from the remote, it will delete my new local file (testlocal.txt). If I push to the remote it will delete the new remote file (testremote.txt). I understand that I can push the specific file and that is a reasonable thing to say for this example but what if hundreds of files have been changed? I guess if this is by design, it needs to be spelled out more explicitly in the wiki and a particular warning for those using -no-prompt. I would suggest that this should not be the intended design. If we were to behave the same as git or rsync a local deletion would lead to a remote deletion and vice versa, but we should not delete files simply because they do not exist in our source. With rsync I believe you can turn on the feature to delete files not in the source. What do you think? |
@sudsy thank you for your great explanation! I see what you are saying and will make the suggested amends to the wiki. However, I'll let @rakyll weigh in and make the decisions concerning design. Let me know what your thoughts are. |
@sudsy I took heed of your suggestion and implemented this feature. I actually find it quite useful as well. It will be useable both for pull and push. It is at: https://github.com/odeke-em/drive |
That's a simple way to solve the problem. I will check it next time I get a chance. |
@odeke-em, am I correct that the feature your're describing is a |
The command does not mention moving all existing files to the 'trash' directory in google drive. Thank god my old files were moved to trash instead of permanent deletion.
The result fater this was only the directory that i push'ed -r . The expectred result is the additive effect of the directory I pushed recursively + old files.
The text was updated successfully, but these errors were encountered: