Pushing My First index.html File to GitHub Using Git Bash 🚀

Hello, fellow coders! 👋 Today, I’m excited to share my journey of pushing my very first index.html file to GitHub using Git Bash. If you’re new to Git and GitHub, don’t worry—I’ll guide you step by step in a simple and friendly way. Let’s get started!

Why GitHub? 🤔

GitHub is like a magical library for your code. It’s a place where you can store, share, and collaborate on projects with others. Whether you’re building a website, an app, or just experimenting with code, GitHub is your best friend. Plus, it’s a great way to showcase your work to the world! 🌍

Step 1: Creating a New Repository on GitHub 🏗️

  1. Log in to your GitHub account.

  2. Click the + icon in the top-right corner and select New Repository.

  3. Give your repository a name (e.g., BinmaApp).

  4. Choose whether you want it to be Public or Private.

  5. Click Create Repository.

    Step 2: Opening Git Bash and Navigating to My Project Folder đź“‚

    Configure git environment by logging into your GitHub from your Git terminal

    1. Open Git Bash on your computer.

    2. Type the following command to enter your username

      Git Config --global user.name (your GitHub username)

      Example Git config --global user.name Subair-09

    3. Type the following command to enter your email associated to your git account

      Git Config --global user.email (your email address)

      Example Git config --global user.email nuddywale@gmail.com

  1. Step 3: Creating a Directory đź“‚in Git Bash and Naming It After My GitHub Repository.

    1. Type this command to create a directory in Git bash and name it your repository name you created in GitHub

      Mkdir BinmaApp

  1. Type this command to CD(Open) into your directory

    cd BinmaApp

    3 Type this command to create a new Git repository in the current directory you created.

    git init

    1. Git init will create a new Git repository folder in the current directory on your local host

    2. Create a file inside the directory using the command Touch and name it index.html

      Touch (file name+file extension)

      Example: Touch index.html

      1. Type this command VI to go into text editor mode and write into your file index.html

        vi index.html

        Click the letter I to go into insertion mode to type into your text edit.

        Save changes by pressing ESC key on your keyboard and :WQ to save changes and exit the text editior

        Copy your code to your Index.hml file.

        Step 4: Connecting My Local Repository to GitHub đź”—

        1. To connect your local repository to Github type the command on your Git terminal

Git remote add origin (http url in your GitHub)

i.e Git remote add origin https://github.com/Subair-09/BinmaApp.git

  1. Type this command to make our index.html file seen on GitHub

    git add index.html

3. Type this command to the status of all the operation you are performing on the Git environment

git status

Step 5: Committing Changes to My Projectđź’ľ

I type the command to Commit to make changes to my project.

A commit is like saving a snapshot of your project. Add a message to describe what you’ve done

Step 6: Pushing My Code to GitHub 🚀

i use the command

git push origin master to push my code to GitHub.

  1. Step 7: index.html was successfully pushed to GitHub 🚀

That’s it! my index.html file is now on GitHub. my file is now seen on my repository on GitHub website.

Pushing my first file to GitHub is a huge milestone in my coding journey. I hope this guide made it easy and fun for you. Happy coding, and may your repositories always be green! đź’š

Feel free to reach out if you have any questions. Let’s build something amazing together! 🚀

1
Subscribe to my newsletter

Read articles from SUBAIR NURUDEEN ADEWALE directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

SUBAIR NURUDEEN ADEWALE
SUBAIR NURUDEEN ADEWALE

Hello! I'm Subair Nurudeen Adewale, a cloud computing enthusiast and the founder of Nucloud Blog. I'm passionate about sharing knowledge and insights on cloud infrastructure, security, innovation, and the intersection of technology and design. As a cloud expert with a keen eye for user experience, I explore the latest trends and best practices in UI/UX, and how they can be applied to create intuitive, user-friendly, and seamless experiences for cloud-based applications and services. Follow Nucloud Blog for the latest updates and insights from the world of cloud computing and UI/UX design.