Sync:未连接到网络或者连接 GitHub 失败。错误信息已打印到控制台

利用Settings Sync同步VSCode插件配置

今天在自己新电脑配置了比较完整的VSCode前端开发插件,然后想将新电脑的配置同步到旧电脑上,百度查到用Settings Sync这个插件,折腾了很久,终于弄好了。参考:https://www.jianshu.com/p/4ffa3b0ad860

参照上面的链接,基本可以实现同步配置。如果Token和Gist ID 都正确拿到的情况下,会出现“Sync:未连接到网络或者连接 GitHub 失败。错误信息已打印到控制台”字眼。如下图所示:

Sync:未连接到网络或者连接 GitHub 失败。错误信息已打印到控制台_第1张图片

就要到C:\Windows\System32\drivers\etc下,将hosts文件还原一下(因为我之前手贱将这个文件给换了,搞到电脑无法访问GitHub网站了)。下面提供最原始最原始的hosts文件,直接复制覆盖你的hosts文件即可:

// hosts文件直接覆盖你自己的那个就行
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

你可能感兴趣的:(Sync:未连接到网络或者连接,GitHub,失败。错误信息已打印到控,Settings,hosts原始文件)