πŸ“ŒDay 12: Linux & Git-GitHub Cheatsheet

Β·

3 min read

πŸ“ŒDay 12: Linux & Git-GitHub Cheatsheet

βœ’οΈHere's a simple cheat sheet for Linux, Git, and GitHub:

🐧 Linux Commands:

CommandPurposeExample Usage
lsList files and directoriesls -l (long format) πŸ“‚
cdChange directorycd Documents πŸ“
pwdPrint working directorypwd πŸ—‚οΈ
mkdirCreate a new directorymkdir my_folder πŸ“
rmRemove files or directoriesrm file.txt πŸ—‘οΈ
cpCopy files or directoriescp file.txt backup/ πŸ“¦
mvMove or rename filesmv old.txt new.txt πŸ”„
chmodChange file permissionschmod 755script.sh πŸ”’
grepSearch for patterns in filesgrep "error" log.txt πŸ”
topMonitor system processestop -n 1 (one-time snapshot) πŸ“Š

πŸ™ Git Commands:

CommandPurposeExample Usage
git initInitialize a new Git repositorygit init 🌱
git cloneClone a remote repositorygit clone <URL> πŸ“₯
git addStage changes for commitgit add file.txt βž•
git commitCommit changes with a messagegit commit -m "Fix bug" πŸ’‘
git statusView the status of filesgit status πŸ“
git logDisplay commit historygit log --oneline πŸ“œ
git branchManage branchesgit branch feature 🌿
git mergeMerge branchesgit merge dev 🀝
git pullFetch changes from a remote repositorygit pull origin main πŸ”„
git pushPush local changes to a remote repositorygit push origin feature πŸš€

🐼 GitHub Commands:

CommandPurposeExample Usage
git remote add origin <URL>Link-local repo to a remote GitHub repogit remote add origin <URL> πŸ”—
git push -u origin <branch>Push changes to GitHubgit push -u origin main πŸš€
git pull origin <branch>Pull changes from GitHubgit pull origin feature πŸ”„
git checkout -b <branch>Create and switch to a new branchgit checkout -b feature 🌱
git forkFork a repository on GitHubgit fork 🍴
git pull-requestCreate a pull requestgit pull-request πŸ“₯

πŸ“š Feel free to use this cheat sheet as a quick reference! πŸš€

Happy Coding :) πŸ™Œβš‘

βœ… Feel free to reach out if you have any questions. I'm delighted to help! 😊

🀝 Let's Connect..!

πŸ”— LinkedIn

πŸ”— Twitter

πŸ”— GitHub

β˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈβ˜€οΈ

Β