A Comprehensive Step-by-Step Guide to My Git and GitHub Learning Experience
This page documents my complete Git learning process — from installation to building a professional webpage. It includes every small detail, command, and challenge I faced while understanding Git and GitHub workflow. I explored concepts like initialization, commits, reverts, authentication tokens, branch management, and documentation.
git --version
Verified that Git was installed on your system.
cd <folder_name>
ls -a
Learned to navigate folders, list hidden files, and understand the difference between working directory and Git repository.
git init
Initialized Git for my project folder, creating a hidden .git directory for version tracking.
git config --global user.name "Username"
git config --global user.email "tocken"
git add .
git commit -m "Added new-file"
Understood the concepts of staging (add) and committing changes.
git status
git log
Learned how to check modified files, commit history, and author details.
git diff
git diff c3.txt
git branch
git checkout <branch>
git status
git add .
git commit -m "Commit message"
git push
git revert <commit-id>
Learned the difference between git revert, git reset, and git checkout.
CONFLICT (modify/delete): c3.txt deleted in parent and modified in HEAD
Resolved manually, marked the resolution with git add, and continued with git revert --continue.
git remote add origin https://github.com/Username/Old_repository.git
git push -u origin master
git remote remove origin
git remote add origin https://github.com/Username/new_repository.git
error: src refspec master does not match any
git branch
git push -u origin main
Created a fine-grained PAT on GitHub with:
Used this token instead of a password for pushing changes.
Learned that a single token with "All repositories" access can be reused for all repositories.
! [rejected] main -> main (fetch first)
Resolved by syncing local and remote repositories:
git fetch origin
git pull origin main --rebase
git push origin main
git add .
git commit -m "Added new file"
git push
Invalid username or token. Password authentication is not supported.
Understood how to check remote status, rebase, and resolve sync issues.
init → add → commit → push → pull → revertThis project represents a complete learning journey in Git and GitHub, combining technical understanding, practical commands, troubleshooting experience, and professional documentation.