Facebook PixelHow to Upload Your First Codebase to GitHub | Blog | CodeWithHarry
How to Upload Your First Codebase to GitHub

How to Upload Your First Codebase to GitHub

"Follow the steps given below to upload your first codebase to GitHub: First of all, you need to install git on Windows. (Download Git from here)..."

By CodeWithHarry

Updated: 5 April 2025

Follow the steps given below to upload your first codebase to GitHub:

  1. First of all, you need to install git on Windows. (Download Git from here)

    Install Git

  2. Install the git in default settings.

  3. After installing git, you need to set your name & email address in the Git configuration. This information will be displayed every time you make a new commit.

    Type the below command to configure your name:

    git config --global user.name "Your Name Here"

    Configure Git Name

  4. Similarly, you need to configure your email address by typing the command given below:

    git config --global user.email "Your Email Here"

    Configure Git Email

  5. Now, head over to github.com and create a new repository in which you want to push your project.

    Create GitHub Repository

  6. Now, right-click on the folder containing the codebase which you want to push to GitHub and select “Open git bash here.” I will be pushing an “index.html” file which is inside my Github Demo folder which you can see in the below animation.

    Open Git Bash

  7. On clicking “Git bash here”, a new git bash terminal window will open!

  8. Now, initialize the local directory as a Git repository by typing:

    git init
  9. Now, you need to add the files to the staging area (git will only track the files inside this area). Run:

    git add .

    Typing the above command will stage all the files inside the local directory. If you want to stage only one file, type:

    git add "file-name"

    Stage Files

  10. The next step is to commit your staged files by typing:

    git commit -m "Type message of your choice here"

    Commit Files

  11. Now, copy the link to the repository which you created in step 6.

    Copy Repository Link

  12. Now, type:

    git remote add origin <Paste-Git-URL-Here>

    Add Remote Origin

  13. The last step is to push your codebase to GitHub. Type the command given below:

    git push origin master

    Push to GitHub

Refresh the repository page and you will see that your files are successfully pushed to Github.

Congratulations on uploading your first codebase on GitHub!

Tags

uploadfirstcodebasetogithub