Github: How to open a repository in vscode with just one button
Hi everyone, welcome to my first post in medium. Today I will like to share my small finding on how to open a Github public repository in vscode without cloning it into our local machine. I found that this is a very useful way for developer when you are looking on some part of the source code or function in Github where not necessary to clone the whole repo into local machine. So, how to do that? Let me show you now below!
First, you have to login to your Github account (if you don’t have, register one, it is free and useful! Your must to have), then search your favorite public repository (e.g. https://github.com/qumonintelligence/go-common ).
Now, it is where magic happens, just simply press you “.” (“dot”) button in the keyboard, and (“Dangla”) Github will open the repository in VSCode editor in your browser for you immediately!
Then you can look into the repository easily with the Web VSCode, you can do the same things as in your local VSCode. Very simple right?
But….. you can check the code only, what if we want to run the code? Can we do that? The answer is…. “Yes you can!!”. How do to that? Let me show you.
Let’s continue our previous step, in the vscode web page, simply add “gitpod.io/#” in front of the URL, and press “Enter”.
Then it will redirect you to Gitpod Dashboard and ask you to login first (if you have login to Gitpod, just skip this). You can choose the way you want to login with.
“Jang”~ Now you have the source code in the Gitpod and you can execute your command in the Gitpod, it will auto detect the language of the source code and download the command needed for you.
I have tried to run “go test” command and it works well.
Now, you can try it with your favorite repository now!
Note
- This trick only works for logged on Github account and public repository, if you want to open your private repository in browser, you can try to open VSCode in Browser, then open you remote repository there.
- This is open repository in web browser, not our local vscode.
References
That’s all from me, thanks for reading until here! This is my first post medium, hope you like this!