π¦ 1β15: Repository Basics
- π₯ git init β Initialize a new repo
- π¦ git clone URL β Clone an existing repo
- π git status β Show file status
- π git add file β Stage file
- π git add . β Stage all changes
- πΈ git commit -m “message” β Commit staged files
- β»οΈ git commit –amend β Amend last commit
- π git log β View commit history
- π’ git log –oneline β Compact log view
- π€ git push β Push to remote
- π₯ git pull β Pull latest changes
- π git fetch β Download changes (no merge)
- π git remote -v β View remote URLs
- β git remote add origin URL β Add a remote
- β git remote remove origin β Remove remote
πΏ 16β30: Branching & Merging
- π± git branch β List branches
- πΏ git branch new-branch β Create new branch
- π git checkout branch β Switch branches
- π³ git checkout -b new-branch β Create & switch branch
- π git merge branch β Merge into current
- β git branch -d branch β Delete branch (safe)
- π£ git branch -D branch β Force delete branch
- π§Ύ git log –graph –all β Branch history
- π git show branch β Show branch commit
- π€ git push origin branch β Push specific branch
- π₯ git pull origin branch β Pull specific branch
- π― git checkout –track origin/branch β Track remote branch
- π git rebase branch β Reapply commits
- π§Ή git stash β Save uncommitted changes
- π₯ git stash pop β Restore last stash
π οΈ 31β45: File & Commit Operations
- π git diff β Compare changes
- π git diff –staged β Compare staged changes
- β git reset file β Unstage a file
- π git restore file β Undo local file changes
- π§Ή git clean -f β Remove untracked files
- π§Ή git clean -fd β Remove untracked dirs/files
- π git reset –soft HEAD~1 β Undo last commit (keep changes)
- π£ git reset –hard HEAD~1 β Undo commit & changes
- π§Ύ git revert commit β Revert a commit (new commit)
- π git blame file β Who changed each line
- π₯ git checkout commit file β Restore file from commit
- π git show commit β View commit details
- π¦ git cherry-pick commit β Apply commit on current branch
- π git log -p β View patch differences
- π git shortlog β Summarized contributors list
π 46β60: Working with Remotes
- π git remote β List remotes
- π€ git push origin main β Push to main branch
- π git push -u origin branch β Push & set upstream
- π₯ git pull origin main β Pull from main
- π§ git remote show origin β Details of remote
- π git fetch origin β Download from remote
- π§ͺ git ls-remote β List refs in remote
- β οΈ git push –force β Force push (use with caution!)
- π git push –tags β Push tags to remote
- π git pull –rebase β Rebase instead of merge
- π€ git push origin –delete branch β Delete remote branch
- π git remote rename old new β Rename remote
- π§Ή git remote prune origin β Remove deleted remote branches
- π git config –list β Show config
- π git config –global user.name “Name” β Set user name
π·οΈ 61β75: Tags, Logs & Tools
- π·οΈ git tag β List tags
- β git tag v1.0 β Create lightweight tag
- π git tag -a v1.0 -m “desc” β Annotated tag
- π€ git push origin v1.0 β Push tag to remote
- β git tag -d v1.0 β Delete local tag
- π§Ό git gc β Cleanup unnecessary files
- π§Ύ git reflog β History of HEAD changes
- π§ git config alias.co checkout β Create alias
- π§° git archive β Export as zip/tar
- π git log –since=”2 weeks ago” β Time-filtered log
- π git show HEAD β View last commit
- π git count-objects -v β Count git objects
- ποΈ git bundle β Bundle for offline transfer
- π¬ git notes add -m “note” β Add commit note
- π‘οΈ git fsck β Integrity check
