[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572761-105":53,"doc-detail-572761-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","git-cheat-sheet-the-essential-git-commands-every-developer-must-know-quick-reference-guide","Git Cheat Sheet - The essential Git commands every developer must know - Quick reference guide","","Git Cheat Sheet condenses essential Git fundamentals into a practical reference for daily development workflows. It covers initializing repositories, staging and committing changes, undoing and discarding local edits, renaming and moving files, viewing diffs, logs, and specific commit content. It also explains history browsing options, filtering and formatting log output, using aliases, comparing commits, checking out historical states, finding bad commits via bisect, identifying contributors, and tracing line authorship with blame. Includes branching, merging, and stashing essentials.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/git-cheat-sheet-the-essential-git-commands-every-developer-must-know-quick-reference-guide/572761/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/git-cheat-sheet-the-essential-git-commands-every-developer-must-know-quick-reference-guide/572761.png","ImageObject",442,249,{"name":88,"@type":89},"Grenda","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-21","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",6,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do you initialize a new Git repository and start tracking files?","Question",{"text":109,"@type":110},"Use git init to initialize a repository. Then stage files with git add (single file, multiple files, patterns, or the whole directory) before committing.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What commands help you inspect changes before and after commits?",{"text":114,"@type":110},"Use git status to view state, git diff to see unstaged changes, and git diff --staged (or git diff --cached) to review staged changes. Use git log to browse commit history and git show to view specific commits.",{"name":116,"@type":107,"acceptedAnswer":117},"How do you manage branches and temporarily save work using stashing?",{"text":118,"@type":110},"Create and switch branches with git branch and git checkout/git switch, then compare branches using git log master..bugfix or git diff master..bugfix. For temporary work, use git stash push to create a stash, view with git stash list/show, apply with git stash apply, and remove with git stash drop.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},572761,1792338098,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":136,"language":137,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":138,"faqs":139,"seo_title":140,"seo_description":61,"update_tm":141,"read_time":47},7971474921005,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","Git Cheat Sheet  \nThe essential Git commands every developer must know  \nThis cheat sheet covers all of the Git commands I’ve covered in my Ultimate Git Mastery course.  \n✓ Creating snapshots  \n✓ Browsing history  \n✓ Branching & merging  \n✓ Collaboration using Git & GitHub  \n✓ Rewriting history  \nHi! My name is Mosh Hamedani. I’m a software engineer with two decades of experience. I’ve taught millions of people how to code or how to become a professional software engineer through my YouTube channel and online coding school. It’s my mission to make software engineering simple and accessible to everyone.  \nCheck out the links below to master the coding skills you need:  \n[https://codewithmosh.com](https://codewithmosh.com)   \n[https://youtube.com/user/programmingwithmosh](https://youtube.com/user/programmingwithmosh)  \n[https://twitter.com/moshhamedani](https://twitter.com/moshhamedani)  \n[https://facebook.com/programmingwithmosh/](https://facebook.com/programmingwithmosh/)  \nWant to master Git?  \nStop wasting your time memorizing Git commands or browsing disconnected tutorials. If you don’t know how Git works, you won’t get far.  \nMy Ultimate Git Mastery course teaches you everything you need to know to use Git like a pro.  \n✓ Learn & understand Git inside out  \n✓ Master the command line  \n✓ Version your code and confidently recover from mistakes  \n✓ Collaborate effectively with others using Git and GitHub  \n✓ Boost your career opportunities  \nClick below to enroll today:  \n[https://codewithmosh.com/p/the-ultimate-git-course/](https://codewithmosh.com/p/the-ultimate-git-course/)  \nTable of Content  \nCreating Snapshots 6  \nBrowsing History 8  \nBranching & Merging 10  \nCollaboration 12  \nRewriting History 13  \nCreating Snapshots  \nInitializing a repository  \ngit init  \nStaging files  \ngit add file1.js \\# Stages a single file  \ngit add file1.js file2.js \\# Stages multiple files  \ngit add * .js \\# Stages with a pattern  \ngit add . \\# Stages the current directory and all its content  \nViewing the status  \ngit status \\# Full status  \ngit status-s \\# Short status  \nCommitting the staged files  \ngit commit-m “Message” \\# Commits with a one-line message  \ngit commit \\# Opens the default editor to type a long message  \nSkipping the staging area  \ngit commit-am “Message”  \nRemoving files  \ngit rm file1.js \\# Removes from working directory and staging area  \ngit rm- -cached file1.js \\# Removes from staging area only  \nRenaming or moving files  \ngit mv file1.js file1.txt  \nViewing the staged/unstaged changes  \ngit diff \\# Shows unstaged changes  \ngit diff- -staged \\# Shows staged changes  \ngit diff- -cached \\# Same as the above  \nViewing the history  \ngit log \\# Full history  \ngit log- -oneline \\# Summary  \ngit log- -reverse \\# Lists the commits from the oldest to the newest  \nViewing a commit  \ngit show 921a2ff \\# Shows the given commit  \ngit show HEAD \\# Shows the last commit  \ngit show HEAD~2 \\# Two steps before the last commit  \ngit show HEAD:file.js \\# Shows the version of file.js stored in the last commit  \nUnstaging files (undoing git add)  \ngit restore- -staged file.js \\# Copies the last version of file.js from repo to index  \nDiscarding local changes  \ngit restore file.js  \ngit restore file1.js file2.js  \ngit restore .  \ngit clean-fd  \n\\# Copies file.js from index to working directory  \n\\# Restores multiple files in working directory  \n\\# Discards all local changes (except untracked files)  \n\\# Removes all untracked files  \nRestoring an earlier version of a file  \ngit restore--source=HEAD~2 file.js  \nBrowsing History  \nViewing the history  \ngit log- -stat \\# Shows the list of modified files  \ngit log--patch \\# Shows the actual changes (patches)  \nFiltering the history  \ngit log-3 \\# Shows the last 3 entries  \ngit log- -author=“Mosh”  \ngit log- -before=“2020-08-17”  \ngit log- -after=“one week ago”  \ngit log--grep=“GUI” \\# Commits with “GUI” in their message  \ngit log-S“GUI” \\# Commits with “GUI” in their patches  \ngit log hash1..has","cbCaiaVkxsplUd4T","https://ap.wps.com/l/cbCaiaVkxsplUd4T","pdf",2563950,13,"English","# Creating Snapshots\n## Initializing a repository\n## Staging files\n## Viewing the status\n## Committing the staged files\n## Skipping the staging area\n## Removing files\n## Renaming or moving files\n## Viewing the staged/unstaged changes\n## Viewing the history\n## Viewing a commit\n## Unstaging files\n## Discarding local changes\n## Restoring an earlier version of a file\n# Browsing History\n## Viewing the history\n## Filtering the history\n## Formatting the log output\n## Creating an alias\n## Comparing commits\n## Checking out a commit\n## Finding a bad commit\n## Finding contributors\n## Viewing the history of a file\n## Finding the author of lines\n# Tagging\n## Tagging commits\n## Listing tags\n## Deleting tags\n# Branching & Merging\n## Managing branches\n## Comparing branches\n# Stashing\n## Creating stashes\n## Listing and viewing stashes\n## Applying and dropping stashes","[{\"question\":\"How do you initialize a new Git repository and start tracking files?\",\"answer\":\"Use git init to initialize a repository. Then stage files with git add (single file, multiple files, patterns, or the whole directory) before committing.\"},{\"question\":\"What commands help you inspect changes before and after commits?\",\"answer\":\"Use git status to view state, git diff to see unstaged changes, and git diff --staged (or git diff --cached) to review staged changes. Use git log to browse commit history and git show to view specific commits.\"},{\"question\":\"How do you manage branches and temporarily save work using stashing?\",\"answer\":\"Create and switch branches with git branch and git checkout/git switch, then compare branches using git log master..bugfix or git diff master..bugfix. For temporary work, use git stash push to create a stash, view with git stash list/show, apply with git stash apply, and remove with git stash drop.\"}]","Git Cheat Sheet - The essential Git commands every developer must know - Quick reference guide | PDF",1791929160]