Search code examples
gitversion-controlvisual-studio-codegist

How do i access git gist from visual studio code(pull/push)?


I want to save my code snippets in the git gist for quicker references. But i want to access it from my ide Visaul Studio Code as well. How can i achieve this?


Solution

  • You can install Gist extension for VS code:

    VS code -> Extensions -> search Gist -> install the extension (such as install the extension https://marketplace.visualstudio.com/items?itemName=kenhowardpdx.vscode-gist for below example) -> after install successful -> reload.

    enter image description here

    Then you can save your code to Gist through VS code directly:

    Open the file you want to save in Gist -> press F1 -> input Gist: create new block -> input description etc.

    To open/edit a relate Gist, you can press F1, and input GIST: Open Block.

    Note: for the first time when creating Gist by VS code, you need to provide your github username and password.