How to Push Code from Visual Studio Code to GitHub

How to Push Code from Visual Studio Code to GitHub

A Code Newbie Learns a New Trick and Shares the Magic

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

Screenshot of authors computer showing VS Code open

2 . Drag the file you want to work on into VS Code as usual

Screenshot of authors computer showing file drag

Screenshot of authors computer showing file open in vscode

3 . Open Github in your browser and create a new repository for your project you'd like to push

Screenshot of authors computer showing github open

Screenshot of authors computer showing github repository

4 . Go back to VScode and click on source control on the lefthand side of the page

Screenshot of authors computer showing cs code open

Screenshot of authors computer showing vscode open

5 . Click on "Initialize repository"

Screenshot of authors computer showing caption previously stated

6 . Type in the commit message and click the check mark to commit (or command enter)

Screenshot of authors computer showing demonstration of caption previously stated

7 . Select "Yes" for committing changes

Screenshot of authors computer showing demonstration of caption previously stated

8 . Click on the 3 tiny circles near the check mark

Screenshot of authors computer showing demonstration of caption previously stated

9 . Click on "Push"

Screenshot of authors computer showing demonstration of caption previously stated

Screenshot of authors computer showing demonstration of caption previously stated

11 . Type in the remote name and hit enter

Screenshot of authors computer showing demonstration of caption previously stated

12 . Click on the 3 dots again and select "Push to"

Screen Shot 2022-06-22 at 5.06.48 PM.png

13 . Select the repository you want to send it to

Screen Shot 2022-06-22 at 5.06.54 PM.png


14 . Your code should be in the remote repository now, Yay!

Screenshot of authors computer showing demonstration of caption previously stated

15 . Check your GitHub repo to see if all the files have transferred by refreshing page

Screenshot of authors computer showing demonstration of caption previously stated

16 . Yay files were transferred for version control!

Screenshot of authors computer showing demonstration of caption previously stated

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?