Open fgallardograzio opened 6 years ago
Incidentally, I was thinking about this over the weekend as well. I think that using version control is a great suggestion and Gists API has the GET /gists/:id/commits
endpoint that could possibly be used for that. I don't have a full understanding of the codebase so am not sure if there are any real-world issues with this approach but it certainly sounds good to me.
BTW, I often get the Failed to save 'settings.json': The content on disk is newer. Click on Compare to compare your version with the one on disk. message when settings.json
is open in VSCode. Just closing it might help.
With the following settings, I get a conflict error writing to the syncSummary.txt I think every time.
"sync.autoDownload": true,
"sync.autoUpload": true,
"sync.forceDownload": false,
"sync.quietSync": false,
(For this, code-settings-sync should write the Sync Summary text out to it's own Output Window.)
Is there any reason why %AppData%\Code\User\
couldn't be a local git repo?
In JetBrains IDEs, WebStorm, PhpStorm, etc, the Settings Sync plug-in uses a git repo. Although the plugin manages the settings git repo in a separate folder from the IDE's actual config files. It then applies changes in the IDE's config files to/from the local git repo and push/pulls.
It gives the user only three manual control options:
Alternatively, you can configure the Sync Settings Plugin to Auto Sync
, where it automatically commits/pushes on exit and pull/merges on start.
There are ~29K code hits in GitHub for Intelli/IDE Settings Repositories. It works fairly well.
I've got the same problem. 3 machines, and I cannot get the settings completely downloaded on my second machine.
Should I create a new issue for my problem? It's pretty much the same thing as above, I'm getting merge errors in the user settings file, on the machines I'm trying to download to. The extensions are installed and other files seem to be pulled down okay. Is there a gitter for this?
Failed to save 'settings.json': The content on disk is newer. Click on Compare to compare your version with the one on disk.
What you can do is to close the files that is going to sync. I will add function to let code close the settings file that will be overwritten. In background complete new file is written but somehow the code editor doesnt update the contents allows file to have conflicts. User often gets error in either syncSummary or settings file.
I will check the commits in Gist api.
@Jeff-Lewis Regarding the Default Sync using Git repo will require major change. You can open new issue and we will see it later on on adding option for git repo like gist but i dont currently have plans to integrate it until v3.0
There are alot of feature request are opened already, and currently i'm working on changing the extension code in order to write tests in future and add sync using file
like gists
@issuehunt has funded $80.00 to this issue.
Hi @shanalikhan , I succeeded in uploading my settings from machine A. However when I try to download into Machine B, I get the following error message:
Sync : Invalid / Expired GitHub Token. Please generate new token with scopes mentioned in readme. Exception Logged in Console.
A question that I have is whether when prompted to enter the token name, it should be the GUID itself, or the human-readable name we give in the github user interface (e.g. code-settings-sync) I've tried a couple of times to re-generate the token, but when I repeat the download command in VS code, I'm not asked for the token name, and thus I don't know how to proceed further :-| can you please help me? thanks in advance,
@omendezmorales Open the command palette and go to >Sync : Advanced Options -> Edit extension local settings
and paste your token into the token
part.
it should be the GUID itself
That is impossible. You can't just get a token by name or any other id. You need the actual token to do anything with the GitHub API.
@fgallardograzio , @borekb
Auto Upload / Download has very much improved since that time.
Also syncSummary.txt
is now replaced by Code Output Window. Settings have UI.
Are you guys still facing this error?
@shanalikhan I need to know when my settings are changing. I'm not sure I would want it to happen automatically in the background. For example, what if I need to temporarily change a setting, but then later I want to revert to the server's version?
It seems like there should be 3 commands:
I'm new to using Settings Sync, but if I understand right does not support the "Sync" command, as I've defined it here. Is that correct?
@octogonz
Nice catch. Yes it doesnt support this functionality, let me see how we can introduce this in upcoming versions.
@arnohovhannisyan we might want to add new sync
function in those refactoring PR so we can improve the sync
for GitHub Gist and Git
Hi @shanalikhan , I have a similar problem.
Suppose I have 2 PCs, called "HOME-PC" and "WORK-PC", both have VScode opened. When I worked on WORK-PC, change some settings and upload (by auto-upload), I have no way to notify HOME-PC to do the download (because auto-download only trigger on vscode startup).
I think the auto-download function should polling the gist repo every 5 mins to detect changes, if there are changes, then just download it. Maybe It can integrated to the "Sync" function which @octogonz had mentioned.
@allenyllee The problem you both have mentioned is out of scope for this issue. Can you open new issue detailing the scenarios so we can look into later on.
@shanalikhan
new issue #984
First of all: Thank you! You've developed a really awesome, must-have tool!
Now, straight to my problem. I want to keep settings synced between 2 PCs, but I'm always getting "conflicts" when downloading because the extension thinks my local settings have diverged from the gist (when IMO that's not the case, of course).
I keep getting errors like this:
Or even like this:
No matter what I change I always get those conflicts, even if it's just one line in
settings.json
(although that means at least two/three, since we have the ever changing "sync.lastUpload" and/or "sync.lastDownload" in that file).For example, I follow this steps:
When doing the initial sync, I've tried having forceDownload both set to false, and set to true, doing the whole flow every time. Same result.
If this is something you've never experienced or heard of, I'd be willing to try with fresh installs and share the full sync history along with each change I've made and command I've run.
However!
I think version control is way out of the scope of this extension. Perhaps there's a fundamental problem with the following suggestion that I'm not seeing, but IMHO this extension should only care about gathering config files and pulling/pushing them to the provided gist. Every gist is a git repository, so we've got every version control feature we need right there, we just need to leverage git's features.
There's no need for the extension to reinvent version control with the gist's cloudSetting's lastUpload timestamp, comparing that with all of the local settings' lastUpload and lastDownload values and whatever. No need to manually implement safe/force download and safe/force upload (Issue #350). Git already does all of that, and it does it well.
I'd love to further discuss this and help code it if you want.
Thanks!
Visual Studio Code Version : 1.16.1 Code Settings Sync Version : 2.8.3 Operating System : Linx Mint 18 Occurs On: Upload and Download Proxy Enabled: No