[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-572759-105":53,"doc-detail-572759-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-git-commands-and-workflows","Git Cheat Sheet - Git commands and workflows","","Git Cheat Sheet provides a compact, command-oriented reference for core Git workflows. It covers configuring commit identity, initializing projects, cloning repositories, and managing day-to-day work with status, add, diff, checkout, reset, commit, rm, and stash. It also explains branching and merge operations, reviewing history via log and reflog, tagging commits, reverting changes safely, and synchronizing with remotes using fetch, pull, and push, including tag handling and upstream setup.",{"@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-git-commands-and-workflows/572759/",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-git-commands-and-workflows/572759.png","ImageObject",442,249,{"name":88,"@type":89},"supergirl","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 set the author name and email used in Git commits?","Question",{"text":109,"@type":110},"Use git config --global user.name to set the commit author name and git config --global user.email to set the commit author email address.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"What is the difference between git fetch and git pull?",{"text":114,"@type":110},"git fetch downloads remote changes without merging into tracking branches, while git pull fetches and merges the current branch with its upstream.",{"name":116,"@type":107,"acceptedAnswer":117},"How do you view commit history and identify commits not merged into a reference?",{"text":118,"@type":110},"Use git log to list history; for comparison, use git log ref.. to show commits on the current branch that are not merged into ref.","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},572759,1792014839,{"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":79,"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":73},962088121634,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","Git Cheat Sheet  \n01 Git configuration  \n$ git config --global [user.name](user.name) “Your Name”  \nSet the name that will be attached to your commits and tags.  \n$ git config --global [user.email](user.email) “[you@example.com](you@example.com)”   \nSet the e-mail address that will be attached to your commits and tags.  \n$ git config --global color.ui auto  \nEnable some colorization of Git output.  \n02 Starting A Project  \n$ git init [project name]  \nCreate a new local repository. If [project name] is provided, Git will create a new directory name [project name] and will initialize a repository inside it. If [project name] is not provided, then a new repository is initialized in the current directory.  \n$ git clone [project url]  \nDownloads a project with the entire history from the remote repository.  \n03 Day-To-Day Work  \n$ git status  \nDisplays the status of your working directory. Options include new, staged, and modified files. It will retrieve branch name, current commit identifier, and changes pending commit.  \n$ git add [file]  \nAdd a file to the staging area. Use in place of the full file path to add all changed files from the current directory down into the directory tree.  \n$ git diff [file]  \nShow changes between working directory and staging area.  \n$ git diff --staged [file]  \nShows any changes between the staging area and the repository.  \n$ git checkout -- [file]  \nDiscard changes in working directory. This operation is unrecoverable.  \n$ git reset [file]  \nRevert your repository to a previous known working state.  \n$ git commit  \nCreate a new commit from changes added to the staging area. The commit must have a message!  \nGitLab | everyone can contribute  [about.gitlab.com](about.gitlab.com)  \n$ git rm [file]  \nRemove file from working directory and staging area.  \n$ git stash  \nPut current changes in your working directory into stash for later use.  \n$ git stash pop  \nApply stored stash content into working directory, and clear stash.  \n$ git stash drop  \nDelete a specific stash from all your previous stashes.  \n04 Git branching model  \n$ git branch [-a]  \nList all local branches in repository. With-a: show all branches (with remote).  \n$ git branch [branch_name]  \nCreate new branch, referencing the current HEAD.  \n$ git checkout [-b][branch_name]  \nSwitch working directory to the specified branch. With-b: Git will create the specified branch if it does not exist.  \n$ git merge [from name]  \nJoin specified [from name] branch into your current branch (the one you are on currently).  \n$ git branch -d [name]  \nRemove selected branch, if it is already merged into any other.  \n-D instead of-d forces deletion.  \n05 Review your work  \n$ git log [-n count]  \nList commit history of current branch. -n count limits list to last n commits.  \n$ git log --oneline --graph --decorate  \nAn overview with reference labels and history graph. One commit per line.  \n$ git log ref..  \nList commits that are present on the current branch and not merged into ref. A ref can be a branch name or a tag name.  \n$ git log ..ref  \nList commit that are present on ref and not merged into current branch.  \n$ git reflog  \nList operations (e.g. checkouts or commits) made on local repository.  \nGitLab | everyone can contribute  [about.gitlab.com](about.gitlab.com)  \n06 Tagging known commits  \n$ git tag  \nList all tags.  \n$ git tag [name] [commit sha]  \nCreate a tag reference named name for current commit. Add commit sha to tag a specific commit instead of current one.  \n$ git tag -a [name] [commit sha]  \nCreate a tag object named name for current commit.  \n$ git tag -d [name]  \nRemove a tag from local repository.  \n07 Reverting changes  \n$ git reset [--hard] [target reference]  \nSwitches the current branch to the target reference, leaving a difference as an uncommitted change. When--hard is used, all changes are discarded.  \n$ git revert [commit sha]  \nCreate a new commit, reverting changes from the specified commit. It generates an inversion of c","cbCaisbaJZphdmHu","https://ap.wps.com/l/cbCaisbaJZphdmHu","pdf",86209,"English","# Git configuration\n## Starting A Project\n## Day-To-Day Work\n## Git branching model\n## Review your work\n## Tagging known commits\n## Reverting changes\n## Synchronizing repositories\n## Ignoring Files\n## Working areas","[{\"question\":\"How do you set the author name and email used in Git commits?\",\"answer\":\"Use git config --global user.name to set the commit author name and git config --global user.email to set the commit author email address.\"},{\"question\":\"What is the difference between git fetch and git pull?\",\"answer\":\"git fetch downloads remote changes without merging into tracking branches, while git pull fetches and merges the current branch with its upstream.\"},{\"question\":\"How do you view commit history and identify commits not merged into a reference?\",\"answer\":\"Use git log to list history; for comparison, use git log ref.. to show commits on the current branch that are not merged into ref.\"}]","Git Cheat Sheet - Git commands and workflows | PDF",1791929153]