The pit of vscode sync plugin to synchronize on different devices

 The benefits of sync are self-evident, you can synchronize your own plugins and all configurations on different devices;

But sometimes there are always pits,

Now record the pits I encountered to prevent stepping on the pits again

VSCode synchronization scheme

The plugin Setting Sync of VSCode provides the function of completing configuration synchronization through Gist of github. However, due to its incomplete tutorial, there will be provincial problems in synchronization. The most common problem is that the configuration cannot be downloaded, and the prompt information is:

Sync : Invalid / Expired GitHub Token. Please generate new token with scopes mentioned in readme. Exception Logged in Console.

Gist can save uploaded configuration files. To pull the configuration file, you need to configure two ids, one is Gist Id and the other is Token Id . The former identifies the configuration file and the latter is used for authentication. The reason we can't download is that we use  Sync:Download Settings Gist id in the command alone, so the error message is invalid token .

So, in fact, the key points are two:

  1. Authenticate, set (new) token (key)

  2. Set the gist id (this basically does not need to be changed, just use the previous gist id)

——————————————————————————————————

 

1. Authenticate, set (new) token (key)

 

Or enter the command in VSCode: Sync:Advanced Options, then select  Sync:Edit Extension Local Settingsand edit  syncLocalSettings.json this configuration file. There is a token in this file that is not set (or the previously expired token is configured), and it needs to be set to Token Id here. You can use the Token set when uploading the configuration file before, or you can create a new Token. The creation steps are as follows:

github recreates a Token

github  github.com/settings/tokens

clipboard.png

clipboard.png

clipboard.png

Note: After being regenerated here gist id , the tokens in the places referenced by this also need to be updated synchronously, otherwise they cannot be used.

 

1. Set the gist id (this basically does not need to be changed, just use the previous gist id)

If you don't know how to get the gist id,

First go to: https://gist.github.com/<username> ---> Then click on your gist file

Then the last parameter on the url is, https://gist.github.com/<username>/ <gist id>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324821028&siteId=291194637