How to Push Code from Visual Studio Code to GitHub
A Code Newbie Learns a New Trick and Shares the Magic
Table of contents
- Pushing Code From VScode to Github
- 1 . Open up VS Code
- 2 . Drag the file you want to work on into VS Code as usual
- 3 . Open Github in your browser and create a new repository for your project you'd like to push
- 4 . Go back to VScode and click on source control on the lefthand side of the page
- 5 . Click on "Initialize repository"
- 6 . Type in the commit message and click the check mark to commit (or command enter)
- 7 . Select "Yes" for committing changes
- 8 . Click on the 3 tiny circles near the check mark
- 9 . Click on "Push"
- 10 . Enter your remote repository link and press enter
- 11 . Type in the remote name and hit enter
- 12 . Click on the 3 dots again and select "Push to"
- 13 . Select the repository you want to send it to
- 14 . Your code should be in the remote repository now, Yay!
- 15 . Check your GitHub repo to see if all the files have transferred by refreshing page
- 16 . Yay files were transferred for version control!
Pushing Code From VScode to Github
Recently, I decided to challenge myself and use the terminal to practice using GitHub. I'd been using GitHub desktop for my coding projects which made it pretty easy to push code to the remote repository with a few clicks. While I now use the terminal to push my code, I found using VScode to directly push was a nice option for those with difficulty navigating their terminal.
If you've never tried this before and use VScode, I encourage you to try it yourself with the below steps!
1 . Open up VS Code
2 . Drag the file you want to work on into VS Code as usual
3 . Open Github in your browser and create a new repository for your project you'd like to push
4 . Go back to VScode and click on source control on the lefthand side of the page
5 . Click on "Initialize repository"
6 . Type in the commit message and click the check mark to commit (or command enter)
7 . Select "Yes" for committing changes
8 . Click on the 3 tiny circles near the check mark
9 . Click on "Push"
10 . Enter your remote repository link and press enter
11 . Type in the remote name and hit enter
12 . Click on the 3 dots again and select "Push to"
13 . Select the repository you want to send it to
14 . Your code should be in the remote repository now, Yay!
15 . Check your GitHub repo to see if all the files have transferred by refreshing page
16 . Yay files were transferred for version control!
I hope this was helpful for anyone who didn't know pushing directly from VSCode was possible. What is your preferred method for pushing to your remote repository?