DEV Community

OLAYEMI OGUNRINDE
OLAYEMI OGUNRINDE

Posted on

Get your Entire folder in VS code to GitHub without having to watch YouTube

Are you new to GitHub? And wondering how to move your work folder πŸ“‚ in VS code to your GitHub account?

Follow my steps without having to go on YouTube.

Step 1: Login to your GitHub account and create a new repository (name your repo anything you wish)

Step 2: Select either public or Private in and scroll down to click on create repository(written in πŸ’š green).

Step 3: Once your repository is created, open your work folder πŸ“ in VS code and click on Terminal on the menu bar where (File, Edit etc are listed)

Step 4: Once your terminal is ready to accept command, try to confirm if the path where you folder πŸ“ is, are correctly written in the terminal e:g C:win/user/Desktop/Folder/$: if it is not correctly listed. just open to where your folder is and copy the entire path and then write this command. πŸ‘‰ cd C:win/user/Desktop/Folder/

Step 5: Now, type git init in front of the path like this. C:win/user/Desktop/Folder/$: git init (and press enter, always after writing a command)

Step 6: You will type git add . make sure there's a space after add before you write dot . Like this C:win/user/Desktop/Folder/$: git add .

Step 7: Now commit your code to reflect on GitHub by writing like this C:win/user/Desktop/Folder/$: git commit -m "testing"

Step 8: create a branch where your folder repo will be live at. Write like this, C:win/user/Desktop/Folder/$: git branch -M main

Step 9: You will have to go back to GitHub and copy your remote origin path to the terminal, what this mean is that it will enable the GitHub remote server to sync and identify your local VS code doc that you're pushing to the GitHub. Like this C:win/user/Desktop/Folder/$: git remote add origin https://github.com/your profile name/your new repository name.git

Step 10: Lastly, Now you can push your entire work folder to GitHub by writing this command line and press enter after it is written git push -u origin main. write like this: C:win/user/Desktop/Folder/$: git push -u origin main

All Commands you need are as follows:

git init
git add .
git commit -m "testing"
git branch -M main
git remote add origin https:github.com/your profile name/your new repository name.git
git push -u origin main

Follow me on GitHub @bisiolayemi we can build together ✊

#github #writing #newbies

Top comments (0)