[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571429-105":53,"doc-detail-571429-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-a-quick-reference-guide","Git Cheat Sheet - A Quick Reference Guide","","Concise, practical Git cheat sheet compiling core commands and workflows for everyday version control. It covers initializing and cloning repositories, setting commit author details, staging and creating commits with messages, inspecting status and history, reviewing differences, and reversing changes via revert, reset, and clean. It also includes tools for rewriting history with amend, rebase, reflog, branching/merging, and managing remotes through fetch, pull, and push.",{"@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-a-quick-reference-guide/571429/",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-a-quick-reference-guide/571429.png","ImageObject",442,249,{"name":88,"@type":89},"Fahsai","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-22","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",8,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"How do I create an empty Git repository and clone an existing one?","Question",{"text":109,"@type":110},"Use git init \u003Cdirectory> to initialize a repository in a specified directory, and git clone \u003Crepo> to copy an existing repository locally.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What is the difference between git revert and git reset for undoing changes?",{"text":114,"@type":110},"git revert \u003Ccommit> creates a new commit that undoes the changes from \u003Ccommit>, while git reset \u003Cfile> or git reset \u003Ccommit> moves/reset the staging area and (depending on flags) working directory to match a target.",{"name":116,"@type":107,"acceptedAnswer":117},"How do I manage remote repositories with Git?",{"text":118,"@type":110},"Add a remote with git remote add \u003Cname> \u003Curl>, then use git fetch, git pull \u003Cremote> to bring remote changes into the local copy, and git push \u003Cremote>\u003Cbranch> to upload commits.","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},571429,1792015515,{"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":76},549768702563,"https://ap-avatar.wpscdn.com/avatar/8000c4aa63b76e948b?x-image-process=image/resize,m_fixed,w_180,h_180&k=1786536092046926083","git init \u003Cdirectory>  \ngit clone \u003Crepo>  \ngit config  \n[user.name](user.name) \u003Cname>  \ngit add  \n\u003Cdirectory> git commit-m\"\u003Cmessage>\"  \ngit status  \ngit log  \ngit diff  \ngit revert \u003Ccommit>  \ngit reset \u003Cfile>  \ngit clean-n  \nGit Basics  \nCreate empty Git repo in speciﬁed directory. Run with no arguments to initialize the current directory as a git repository.  \nClone repo located at \u003Crepo> onto local machine. Original repo can be located on the local ﬁlesystem or on a remote machine via [HTTP or SSH](HTTP or SSH).  \nDeﬁne author name to be used for all commits in current repo. Devs commonly use--global ﬂag to set conﬁg options for current user.  \nStage all changes in \u003Cdirectory> for the next commit. Replace \u003Cdirectory> with a \u003Cﬁle> to change a speciﬁc ﬁle.  \nCommit the staged snapshot, but instead of launching a text editor, use \u003Cmessage> as the commit message.  \nList which ﬁles are staged, unstaged, and untracked.  \nDisplay the entire commit history using the default format. For customization see additional options.  \nShow unstaged changes between your index and working directory  \nCreate new commit that undoes all of the changes made in \u003Ccommit>, then apply it to the current branch.  \nRemove \u003Cﬁle> from the staging area, but leave the working directory unchanged. This unstages a ﬁle without overwriting any changes.  \nShows which ﬁles would be removed from working directory. Use the-f ﬂag in place of the-n ﬂag to execute the clean.  \nRewriting Git History  \ngit commit--amend  \ngit rebase \u003Cbase>  \ngit reflog  \ngit branch  \ngit checkout-b \u003Cbranch>  \ngit merge \u003Cbranch>  \ngit remote add \u003Cname> \u003Curl>  \ngit fetch  \n\u003Cremote> \u003Cbranch>  \ngit pull \u003Cremote>  \ngit push \u003Cremote>\u003Cbranch>  \nReplace the last commit with the staged changes and last commit combined. Use with nothing staged to edit the last commit’s message.  \nRebase the current branch onto \u003Cbase> . \u003Cbase> can be a commit ID, a branch name, a tag, or a relative reference to HEAD.  \nShow a log of changes to the local repository's HEAD. Add--relativedate ﬂag to show date info or--all to show all refs.  \nList all of the branches in your repo. Add a \u003Cbranch> argument to create a new branch with the name \u003Cbranch> .  \nCreate and check out a new branch named \u003Cbranch> . Drop the-b ﬂag to checkout an existing branch.  \nMerge \u003Cbranch> into the current branch.  \nRemote Repositories  \nCreate a new connection to a remote repo. After adding a remote, you can use \u003Cname> as a shortcut for \u003Curl> in other commands.  \nFetches a speciﬁc \u003Cbranch>, from the repo. Leave off \u003Cbranch> to fetch all remote refs.  \nFetch the speciﬁed remote’s copy of current branch and immediately merge it into the local copy.  \nPush the branch to \u003Cremote>, along with necessary commits and objects. Creates named branch in the remote repo if it doesn’t exist.  \nGit Cheat Sheet  \n+  \n+  \n+  \n+  \n+  \n+  \n+  \nGit Branches  \nUndoing Changes  \n[Visit](Visit atlassian.com/git for more)[ atlassian.com/git](Visit atlassian.com/git for more)[ for more](Visit atlassian.com/git for more) information, training, and tutorials page 1  \nAdditional Options +   \ngit conﬁg git diﬀ  \ngit config--global [user.name](user.name) \u003Cname>  \ngit config--global [user.email](user.email) \u003Cemail>  \ngit config--global alias .\u003Calias-name>\u003Cgit-command>  \ngit config--system core .editor \u003Ceditor>  \ngit config--global--edit  \ngit log-\u003Climit>  \ngit log--oneline  \ngit log--stat  \ngit log-p  \ngit log  \n--author=\"\u003Cpattern>\"  \ngit log  \n--grep=\"\u003Cpattern>\"  \ngit log  \n\u003Csince>..\u003Cuntil>  \ngit log-- \u003Cfile>  \ngit log--graph--decorate  \n\n| Deﬁne the author name to be used for all commits by the current user.\u003Cbr>Deﬁne the author email to be used for all commits by the current user.\u003Cbr>Create shortcut for a Git command. E. g. alias.glog \"log--graph\u003Cbr>--oneline\"will set \"git glog\" equivalent to \"git log--graph--oneline\"\u003Cbr>Set text editor used by commands for all users on the machine. \u003Ceditor> arg should be the command that launches the desired editor (e. g. , vi) .\u003Cbr>Open","cbCaiu9MuqOgtOFR","https://ap.wps.com/l/cbCaiu9MuqOgtOFR","pdf",743351,7,"English","# Git Basics\n## Create, Clone, Configure\n## Stage, Commit, Inspect\n# Rewriting Git History\n# Git Branches\n# Undoing Changes\n# Remote Repositories\n## Fetch, Pull, Push","[{\"question\":\"How do I create an empty Git repository and clone an existing one?\",\"answer\":\"Use git init \\u003cdirectory\\u003e to initialize a repository in a specified directory, and git clone \\u003crepo\\u003e to copy an existing repository locally.\"},{\"question\":\"What is the difference between git revert and git reset for undoing changes?\",\"answer\":\"git revert \\u003ccommit\\u003e creates a new commit that undoes the changes from \\u003ccommit\\u003e, while git reset \\u003cfile\\u003e or git reset \\u003ccommit\\u003e moves/reset the staging area and (depending on flags) working directory to match a target.\"},{\"question\":\"How do I manage remote repositories with Git?\",\"answer\":\"Add a remote with git remote add \\u003cname\\u003e \\u003curl\\u003e, then use git fetch, git pull \\u003cremote\\u003e to bring remote changes into the local copy, and git push \\u003cremote\\u003e\\u003cbranch\\u003e to upload commits.\"}]","Git Cheat Sheet - A Quick Reference Guide | PDF",1791916947]