Developer Cheat Sheets
Quick reference for Git commands and Linux basics in Sinhala and English
git initInitialize a new Git repository
අලුත් Git repository එකක් පටන් ගන්න
git initgit clone <url>Clone a repository from remote
Repository එකක් copy කරන්න
git clone https://github.com/user/repo.gitgit add <file>Add file to staging area
file එකක් staging area එකට එකතු කරන්න
git add index.htmlgit add .Add all files to staging area
සියලුම files staging area එකට එකතු කරන්න
git add .git commit -m 'message'Commit changes with message
වෙනස්කම් ටික message එකක් එක්ක commit කරන්න
git commit -m 'Add new feature'git statusCheck repository status
repository එකේ තත්වය පරීක්ෂා කරන්න
git statusgit logView commit history
commit කරපු ඉතිහාසය බලන්න
git log --oneline --graphgit push origin <branch>Push changes to remote branch
වෙනස්කම් remote branch එකට push කරන්න
git push origin maingit pullPull latest changes from remote
remote එකෙන් අලුත් වෙනස්කම් pull කරන්න
git pull origin maingit branchList all branches
සියලුම branches බලාගන්න
git branch -agit checkout <branch>Switch to branch
branch එකට මාරු වන්න
git checkout developgit checkout -b <branch>Create and switch to new branch
නව branch එකක් හදලා ඒකට මාරු වන්න
git checkout -b feature/logingit merge <branch>Merge branch into current branch
branch එක දැන් branch එකට merge කරන්න
git merge feature/logingit stashTemporarily save uncommitted changes
commit නොකළ වෙනස්කම් තාවකාලිකව save කරන්න
git stash push -m 'work in progress'git stash popApply and remove latest stash
අවසාන stash එක apply කර remove කරන්න
git stash popgit diffShow changes between commits, commit and working tree, etc.
commits, working tree අතර වෙනස්කම් පෙන්වන්න
git diff HEAD~1git reflogShow a log of reference changes (e.g., HEAD changes). Your safety net!
Reference වෙනස්වීම් වල log එක බලන්න
git refloggit rebase -i HEAD~<n>Interactively rebase the last <n> commits (squash, edit, reorder).
අවසාන commits <n> ගණන interactiveව rebase කරන්න.
git rebase -i HEAD~3git bisectFind the commit that introduced a bug using binary search.
Binary search මගින් bug එකක් හඳුන්වා දුන් commit එක සොයාගන්න.
git bisect start; git bisect bad; git bisect good <commit-hash>git cherry-pick <commit-hash>Apply the changes from a specific commit onto the current branch.
වෙනත් branch එකක commit එකක් දැන් branch එකට apply කරන්න.
git cherry-pick a1b2c3d4git reset --soft HEAD~1Uncommit changes, keeping them in the staging area.
අවසන් commit එක cancel කර, වෙනස්කම් staging area එකේ තියාගන්න.
git reset --soft HEAD~1