[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571424-105":53,"doc-detail-571424-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-quick-reference-for-core-git-commands","Git Cheat Sheet - Quick reference for core Git commands","","Quick reference for essential Git workflows, covering repository setup, cloning, staging files, committing changes, and managing branches. Includes practical commands for moving between branches, creating and deleting branches, and inspecting differences between staged, unstaged, and commit history. Also details ways to discard changes, undo and amend commits, analyze commit history and code changes, combine diverged branches, fast-forward merges, and share work via push and pull. Finishes with basic Git configuration and important file locations.",{"@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-quick-reference-for-core-git-commands/571424/",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-quick-reference-for-core-git-commands/571424.png","ImageObject",442,249,{"name":88,"@type":89},"WPS_1786070896","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 I initialize a new Git repository and clone an existing one?","Question",{"text":109,"@type":110},"Use `git init` to start a new repo, and `git clone \u003Curl>` to clone an existing repository.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What commands help me stage changes and choose specific parts of files?",{"text":114,"@type":110},"Use `git add \u003Cfile>` to add a file, `git add .` for all changes, and `git add -p` to stage selected hunks.",{"name":116,"@type":107,"acceptedAnswer":117},"How can I review differences and commit history in Git?",{"text":118,"@type":110},"Use `git diff` variants (`--staged`, `HEAD`) for changes, `git show \u003Ccommit>` for a commit’s diff, and `git log` commands (including `--follow` and `--graph`) to inspect history.","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},571424,1792360018,{"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":73,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":9},549768072016,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","--print-out  \nGetting Started  \nStart a new repo: git init  \nClone an existing repo: git clone \u003Curl>  \nPrepare to Commit  \nAdd untracked file or unstaged changes: git add \u003Cfile>  \nAdd all untracked files and unstaged changes: git add .  \nChoose which parts of a file to stage:  \ngit add -p Move file:  \ngit mv \u003Cold> \u003Cnew>  \nDelete file:  \ngit rm \u003Cfile>  \nTell Git to forget about a file without deleting it: git rm --cached \u003Cfile>  \nUnstage one file: git reset \u003Cfile>  \nOR  \ngit restore --staged \u003Cfile>  \nUnstage everything: git reset  \nOR  \ngit restore --staged .  \nCheck what you added: git status  \nMake Commits  \nMake a commit (and open text editor to write message):  \ngit commit Make a commit:  \ngit commit -m 'message 'Commit all unstaged changes:  \ngit commit -am 'message '  \nGit Cheat Sheet  \nMove Between Branches  \nSwitch branches: git switch \u003Cname>  \nOR  \ngit checkout \u003Cname>  \nCreate a branch:  \ngit switch -c \u003Cname>  \nOR  \ngit checkout -b \u003Cname> List branches:  \ngit branch  \nList branches by most recently committed to: git branch --sort= -committerdate Delete a branch:  \ngit branch -d \u003Cname> Force delete a branch:  \ngit branch -D \u003Cname>  \nDiff Staged/Unstaged Changes  \nDiff all staged and unstaged changes: git diff HEAD  \nDiff just staged changes: git diff --staged  \nDiff just unstaged changes: git diff  \nDiff Commits  \nShow diff between a commit and its parent:  \ngit show \u003Ccommit> Diff two commits:  \ngit diff \u003Ccommit> \u003Ccommit>  \nDiff one file since a commit: git diff \u003Ccommit> \u003Cfile>  \nShow a summary of a diff: git diff \u003Ccommit> --stat git show \u003Ccommit> --stat  \n\n| Ways to refer to a commit\u003Cbr>Every time we say \u003Ccommit> , you can use any of these: |  |  |  |\n| --- | --- | --- | --- |\n|  | ★ a branch\u003Cbr>★ a tag\u003Cbr>★ a commit ID\u003Cbr>★ a remote branch\u003Cbr>★ current commit\u003Cbr>★ 3 commits ago | main\u003Cbr>v0 .1 3e887ab origin/main HEAD\u003Cbr>HEAD^^^ or HEAD~ 3 |  |\n\nDiscard Your Changes  \nDelete unstaged changes to one file: git restore \u003Cfile>  \nOR  \ngit checkout \u003Cfile>  \nDelete all staged and unstaged changes to one file:  \ngit restore --staged --worktree \u003Cfile>  \nOR  \ngit checkout HEAD \u003Cfile>  \nDelete all staged and unstaged changes: git reset --hard  \nOR  \ngit restore --staged --worktree .  \nDelete untracked files: git clean  \n'Stash' all staged and unstaged changes: git stash  \nEdit History  \n\"Undo\" the most recent commit (keep your working directory the same):  \ngit reset HEAD^  \nSquash the last 5 commits into one: git rebase -i HEAD ~ 5  \nThen change \"pick\" to \"fixup\" for any commit you want to combine with the previous one  \nUndo a failed rebase: git reflog BRANCHNAME  \nThen manually find the right commit ID in thereflog , then run:  \ngit reset --hard \u003Ccommit>  \nChange a commit message (or add a file you forgot):  \ngit commit --amend  \nCode Archaeology  \nLook at a branch's history: git log main  \ngit log --graph main  \ngit log --oneline  \nShow every commit that modified a file: git log \u003Cfile>  \nShow every commit that modified a file , including before it was renamed:  \ngit log --follow \u003Cfile>  \nFind every commit that added or removed some text:  \ngit log -G banana  \nShow who last changed each line of a file: git blame \u003Cfile>  \n\n| Combine Diverged Branches\u003Cbr>Combine with rebase: git switch banana\u003Cbr>git rebase main Before: |  |\n| --- | --- |\n| \u003Cbr>~~ ~~ main\u003Cbr>banana |  |\n| After:\u003Cbr>main banana |  |\n| \u003Cbr>\"lost \" |  |\n| Combine with merge: git switch main\u003Cbr>git merge banana Before: |  |\n| \u003Cbr>~~ ~~ main\u003Cbr>banana |  |\n| After: |  |\n| \u003Cbr>main\u003Cbr>banana |  |\n| Combine with squash merge: git switch main\u003Cbr>git merge --squash banana\u003Cbr>git commit Before: |  |\n| \u003Cbr>~~ ~~ main\u003Cbr>banana |  |\n| After: |  |\n| | main\u003Cbr>banana |\n\n\n| Bring a branch up to date with another branch (aka \"fast-forward merge\"):\u003Cbr>git switch main\u003Cbr>git merge banana Before:\u003Cbr>A B C D\u003Cbr>E\u003Cbr>main banana\u003Cbr>After: |\n| --- |\n| A B C D E\u003Cbr>main |\n| \u003Cbr>banana\u003Cbr>Copy one commit onto the current branch: git cherry-pick \u003Ccommit>\u003Cbr>Before: |\n| \u003Cbr>~~ ~~ main |\n","cbCaibfQ2gnYVLDy","https://ap.wps.com/l/cbCaibfQ2gnYVLDy","pdf",101898,"English","# Getting Started\n# Prepare to Commit\n## Staging and moving files\n# Make Commits\n# Move Between Branches\n# Diff and Inspect Changes\n# Discard Your Changes\n# Edit History\n# Code Archaeology\n# Combine and Update Branches\n# Push and Pull Changes\n# Configure Git\n## Important files","[{\"question\":\"How do I initialize a new Git repository and clone an existing one?\",\"answer\":\"Use `git init` to start a new repo, and `git clone \\u003curl\\u003e` to clone an existing repository.\"},{\"question\":\"What commands help me stage changes and choose specific parts of files?\",\"answer\":\"Use `git add \\u003cfile\\u003e` to add a file, `git add .` for all changes, and `git add -p` to stage selected hunks.\"},{\"question\":\"How can I review differences and commit history in Git?\",\"answer\":\"Use `git diff` variants (`--staged`, `HEAD`) for changes, `git show \\u003ccommit\\u003e` for a commit’s diff, and `git log` commands (including `--follow` and `--graph`) to inspect history.\"}]","Git Cheat Sheet - Quick reference for core Git commands | PDF",1791916934]