How to use(initialize repository) in Github using git and Visual Studio (VS code)

  1. Create a Github Account.

  2. Now you must also download git from https://git-scm.com/download/win. Or simply search git in your brower the first link will probably be one for git.You can click into this image that will redirect to the website.

  3. Now click on Click here to download for latest version.

  4. After git has been downloaded you must set up git, just tick every field and do next until git is setup.

  5. Now once git is installed, open git bash by searching into your windows search bar and you must enter some commands for git to run along with vs code.

  6. Now you must add your username and email into git bash.

  7. To enter username the command is:
    git config --global user.name "yourname"
    You must write your name in place of yourname in command. Then press enter.

  8. Continue in same page. Now you must enter your email. To enter email the command is:
    git config --global user.email "nickeshadhikari@gmail.com"
    You must enter your email instead of my email. Then press enter.

  9. Now you can check wheather your username and email is saved or not by running a command in the same page. The command:
    git config --list
    Then press enter.

  10. Your email and name will be shown as above if commands entered correctly.

  11. Step 1 to Step 9 is only required for FIRST TIME and once these steps are done they shouldn't be done for next time for initializing other Reposiories. After first Initialization follow from step 11.

  12. Now after creating an Account in github and setting up git, you will have such preview in your github account. Then click in plus + icon near the search bar. Now you will get these options, you must then choose New repository among those options.

  13. Now you have to name your Repository. Name it according to title of your website.

  14. After giving name to your repository let other option as it is and click in create repository.

  15. Now you will be provided a link of your repository by github itself. Copy the link.

  16. You must have a separate folder that you want to publish in github.

  17. Also be careful when you name your HTML file. You must name the file that opens first as index.html else your HTML code won't work for your website.

  18. Now go to VS code I assume you know basics of programming and know how to code using HTML.

  19. Your Visual Studio Code should have such preview.

  20. Now click in third icon below search in the left of vs code (that is git).

  21. Now an initialize Repository option will appear click initialize repository.

  22. Now click on three dots that appears at right top of message box and go to remote and click add remote.

  23. Now add link of your repository in above search bar setion of vs code. Just paste the previous that you copied from github as your repository link.

  24. Now add the name that you want to give to your remote.

  25. After giving remote name, Now click + icon that is besides changes as below.

  26. Now add message in message box above commit option. you can add anything in short that defines your commit. Like "first commit" for your first commit.

  27. Now click into Commit.

  28. Now click Publish Branch.

  29. Now you can view your reposiory in your github profile as below.

  30. Now click into your repository that you want to publish live as website.

  31. Now go to settings of your repository and on left side of setting you can find pages. Go to pages.

  32. Now on branch opion choose main, if you don't have main choose master and on second option choose root and click save.

  33. Now your website has been published and is live to be view by any one. It will take few minutes (less than 5 minutes) for it to publish.

  34. Such link will appear when website is ready. Link will appear in pages.

CONGRATULATIONS!!

Now you can share the link of your website with any one.
Social Media Handles