Working With Git And Github
Source: Dev.to

What is Git?
Git is a free and open‑source distributed version‑control system. It tracks changes in any set of files and is most commonly used to coordinate work among programmers collaborating on source‑code projects.
Essential Git Commands
| Command | Description |
|---|---|
git push | Uploads local repository content to a remote repository. |
git commit -m "" | Records a snapshot of the repository with a descriptive message. |
git add <file> | Stages changes in the working directory for the next commit. |
git remote add origin <url> | Registers a new remote repository (usually on GitHub). |
git remote -v | Lists the current remote URLs. |
git config --list | Shows the current Git configuration. |
Note: You’ll need the remote URL for your repository and, if required, authentication credentials.
How to Push from Your Local Environment to GitHub
- Download Git Bash – Choose the version compatible with your OS.
- Configure Git Bash – Give Git your identity.
- Work with the Configured Environment – Create a project folder, initialise a repo, etc.
- Clone Your GitHub Repository – Bring an existing remote repo to your machine.
- Push to GitHub – Send local commits to the remote.
- Show the Content – Verify everything is in place.
1️⃣ Download Git Bash
Install the latest Git for Windows from the official site:
2️⃣ Configure Git Bash (Set Your Identity)
# Set your name (replace <name> with your actual name)
git config --global user.name ""
# Set your email (replace <email> with your actual email)
git config --global user.email ""


# Verify the configuration
git config --list

3️⃣ Work with the Configured Environment
# Create a directory for your project
mkdir website
# Enter the directory
cd website
# Initialise a new Git repository
git init
# Check the repository status
git status


# Create an index.html file
touch index.html
# Open it with vim (or any editor you prefer)
vim index.html

In vim, press
ito enter Insert mode, edit the file, then pressEscfollowed by:wqto save and quit.
4️⃣ Add, Commit, and Push
# Stage the new file
git add index.html
# Commit with a message
git commit -m "Add initial index.html"
# Add the remote repository (replace <url> with your GitHub repo URL)
git remote add origin
# Push the commit to the remote master/main branch
git push -u origin master # or `main` if your default branch is named main
5️⃣ Verify on GitHub
Visit your repository page on GitHub to confirm that index.html appears in the file list.
Happy coding! 🎉
If you run into any issues, double‑check the remote URL and ensure your credentials (SSH key or personal access token) are correctly set up.
Clone Your GitHub Repository
-
Go to your GitHub page – click the + button and select New repository.

-
Initialize the repository (add a README, .gitignore, license, etc.) and click Create repository.

-
Copy the HTTPS URL
On the next page click Code → HTTPS and copy the URL that appears.

-
Clone the repository locally
Open Git Bash (or your preferred terminal) and run:
git remote add origin
Push to GitHub
We need to move the index.html file we added to the staging area, commit it, and then push it to the remote repository.
-
Check the status
git status
-
Stage the file
git add index.html
-
Verify the staging
git statusThe file name should now appear in green, indicating it is staged.

-
Commit the change
git commit -m "Add index.html"
-
Push to GitHub
git push origin master
Show the Content
Open the GitHub Pages URL (or the repository’s raw file view) to verify that index.html is now live.

All images retain their original sources; only the markdown structure has been cleaned up for readability.
Thank You For Your Time. Till The Next Post.

