Git Basics – Commands

Git Basics – Commands

Initialize Repository

git init

Check Status

git status

Add Files

git add filename
git add .

Commit Changes

git commit -m "Add login feature"

View History

git log
git log --oneline

Difference Between add & commit

  • add → Move changes to staging area

  • commit → Save changes permanently

Undo Changes

git checkout -- filename
git reset HEAD filename
git revert commit_id


Comments

Popular posts from this blog

Database Integration in FastAPI (SQLAlchemy CRUD)

Middleware & CORS in FastAPI

Python Data Handling