[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-573":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":10,"languages":10,"totalLinesOfCode":10,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},573,"github-cheat-sheet","tiimgreen\u002Fgithub-cheat-sheet","tiimgreen","A list of cool features of Git and GitHub.","http:\u002F\u002Fgit.io\u002Fsheet",null,57310,5427,1363,28,0,16,101,535,78,90,"MIT License",false,"master",[25,26,27,28,29],"awesome","awesome-list","git","github","list","2026-06-11 04:00:32","# GitHub Cheat Sheet [![Awesome](https:\u002F\u002Fcdn.rawgit.com\u002Fsindresorhus\u002Fawesome\u002Fd7305f38d29fed78fa85652e3a63e154dd8e8829\u002Fmedia\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsindresorhus\u002Fawesome)\nA collection of cool hidden and not so hidden features of Git and GitHub. This cheat sheet was inspired by [Zach Holman](https:\u002F\u002Fgithub.com\u002Fholman)'s [Git and GitHub Secrets](http:\u002F\u002Fconfreaks.tv\u002Fvideos\u002Faloharuby2012-git-and-github-secrets) talk at Aloha Ruby Conference 2012 ([slides](https:\u002F\u002Fspeakerdeck.com\u002Fholman\u002Fgit-and-github-secrets)) and his [More Git and GitHub Secrets](https:\u002F\u002Fvimeo.com\u002F72955426) talk at WDCNZ 2013 ([slides](https:\u002F\u002Fspeakerdeck.com\u002Fholman\u002Fmore-git-and-github-secrets)).\n\n*Shortlink: [`http:\u002F\u002Fgit.io\u002Fsheet`](http:\u002F\u002Fgit.io\u002Fsheet)*\n\n*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).*\n\nGitHub Cheat Sheet is sponsored by [Snapshot: create interactive professional-quality product photos using AI](https:\u002F\u002Fwww.snapshotapp.io\u002F)\n\n## Table of Contents\n  - [GitHub](#github)\n    - [Ignore Whitespace](#ignore-whitespace)\n    - [Adjust Tab Space](#adjust-tab-space)\n    - [Commit History by Author](#commit-history-by-author)\n    - [Cloning a Repository](#cloning-a-repository)\n    - [Branch](#branch)\n      - [Compare all Branches to Another Branch](#compare-all-branches-to-another-branch)\n      - [Comparing Branches](#comparing-branches)\n      - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories)\n    - [Gists](#gists)\n    - [Git.io](#gitio)\n    - [Keyboard Shortcuts](#keyboard-shortcuts)\n    - [Line Highlighting in Repositories](#line-highlighting-in-repositories)\n    - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages)\n    - [Cross-Link Issues](#cross-link-issues)\n    - [Locking Conversations](#locking-conversations)\n    - [CI Status on Pull Requests](#ci-status-on-pull-requests)\n    - [Filters](#filters)\n    - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files)\n    - [Emojis](#emojis)\n    - [Images\u002FGIFs](#imagesgifs)\n      - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki)\n    - [Quick Quoting](#quick-quoting)\n    - [Pasting Clipboard Image to Comments](#pasting-clipboard-image-to-comments)\n    - [Quick Licensing](#quick-licensing)\n    - [Task Lists](#task-lists)\n      - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents)\n    - [Relative Links](#relative-links)\n    - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages)\n    - [Viewing YAML Metadata in your Documents](#viewing-yaml-metadata-in-your-documents)\n    - [Rendering Tabular Data](#rendering-tabular-data)\n    - [Rendering PDF](#rendering-pdf)\n    - [Revert a Pull Request](#revert-a-pull-request)\n    - [Diffs](#diffs)\n      - [Rendered Prose Diffs](#rendered-prose-diffs)\n      - [Diffable Maps](#diffable-maps)\n      - [Expanding Context in Diffs](#expanding-context-in-diffs)\n      - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request)\n      - [Rendering and diffing images](#rendering-and-diffing-images)\n    - [Hub](#hub)\n    - [Contribution Guidelines](#contribution-guidelines)\n      - [CONTRIBUTING file](#contributing-file)\n      - [ISSUE_TEMPLATE file](#issue_template-file)\n      - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file)\n    - [Octicons](#octicons)\n    - [GitHub Student Developer Pack](#github-student-developer-pack)\n    - [GitHub Resources](#github-resources)\n      - [GitHub Talks](#github-talks)\n    - [SSH keys](#ssh-keys)\n    - [Profile Image](#profile-image)\n    - [Repository Templates](#repository-templates)\n  - [Git](#git)\n    - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree)\n    - [Previous Branch](#previous-branch)\n    - [Stripspace](#stripspace)\n    - [Checking out Pull Requests](#checking-out-pull-requests)\n    - [Empty Commits](#empty-commits)\n    - [Styled Git Status](#styled-git-status)\n    - [Styled Git Log](#styled-git-log)\n    - [Git Query](#git-query)\n    - [Git Grep](#git-grep)\n    - [Merged Branches](#merged-branches)\n    - [Fixup and Autosquash](#fixup-and-autosquash)\n    - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories)\n    - [Git Configurations](#git-configurations)\n      - [Aliases](#aliases)\n      - [Auto-Correct](#auto-correct)\n      - [Color](#color)\n    - [Git Resources](#git-resources)\n      - [Git Books](#git-books)\n      - [Git Videos](#git-videos)\n      - [Git Articles](#git-articles)\n\n\n## GitHub\n### Ignore Whitespace\nAdding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only the code that has changed.\n\n![Diff without whitespace](https:\u002F\u002Fcamo.githubusercontent.com\u002F797184940defadec00393e6559b835358a863eeb\u002F68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67)\n\n[*Read more about GitHub secrets.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F967-github-secrets)\n\n### Adjust Tab Space\nAdding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome extension](https:\u002F\u002Fchrome.google.com\u002Fwebstore\u002Fdetail\u002Ftab-size-on-github\u002Fofjbgncegkdemndciafljngjbdpfmbkn) can automate this.\n\nHere is a Go source file before adding `?ts=4`:\n\n![Before, tab space example](http:\u002F\u002Fi.imgur.com\u002FGIT1Fr0.png)\n\n...and this is after adding `?ts=4`:\n\n![After, tab space example](http:\u002F\u002Fi.imgur.com\u002F70FL4H9.png)\n\n### Commit History by Author\nTo view all commits on a repo by author add `?author={user}` to the URL.\n\n```\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcommits\u002Fmaster?author=dhh\n```\n\n![DHH commit history](http:\u002F\u002Fi.imgur.com\u002FS7AE29b.png)\n\n[*Read more about the differences between commits views.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fdifferences-between-commit-views\u002F)\n\n### Cloning a Repository\nWhen cloning a repository the `.git` can be left off the end.\n\n```bash\n$ git clone https:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet\n```\n\n[*Read more about the Git `clone` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-clone)\n\n### Branch\n#### Compare all Branches to Another Branch\n\nIf you go to the repo's [Branches](https:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet\u002Fbranches) page, next to the Commits button:\n\n```\nhttps:\u002F\u002Fgithub.com\u002F{user}\u002F{repo}\u002Fbranches\n```\n\n... you would see a list of all branches which are not merged into the main branch.\n\nFrom here you can access the compare page or delete a branch with a click of a button.\n\n![Compare branches not merged into master in rails\u002Frails repo - https:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fbranches](http:\u002F\u002Fi.imgur.com\u002F0FEe30z.png)\n\n#### Comparing Branches\nTo use GitHub to compare branches, change the URL to look like this:\n\n```\nhttps:\u002F\u002Fgithub.com\u002F{user}\u002F{repo}\u002Fcompare\u002F{range}\n```\n\nwhere `{range} = master...4-1-stable`\n\nFor example:\n\n```\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcompare\u002Fmaster...4-1-stable\n```\n\n![Rails branch compare example](http:\u002F\u002Fi.imgur.com\u002FtIRCOsK.png)\n\n`{range}` can be changed to things like:\n\n```\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcompare\u002Fmaster@{1.day.ago}...master\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcompare\u002Fmaster@{2014-10-04}...master\n```\n\n*Here, dates are in the format `YYYY-MM-DD`*\n\n![Another compare example](http:\u002F\u002Fi.imgur.com\u002F5dtzESz.png)\n\nBranches can also be compared in `diff` and `patch` views:\n\n```\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcompare\u002Fmaster...4-1-stable.diff\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcompare\u002Fmaster...4-1-stable.patch\n```\n\n[*Read more about comparing commits across time.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fcomparing-commits-across-time\u002F)\n\n#### Compare Branches across Forked Repositories\nTo use GitHub to compare branches across forked repositories, change the URL to look like this:\n\n```\nhttps:\u002F\u002Fgithub.com\u002F{user}\u002F{repo}\u002Fcompare\u002F{foreign-user}:{branch}...{own-branch}\n```\n\nFor example:\n\n```\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fcompare\u002Fbyroot:master...master\n```\n\n![Forked branch compare](http:\u002F\u002Fi.imgur.com\u002FQ1W6qcB.png)\n\n### Gists\n[Gists](https:\u002F\u002Fgist.github.com\u002F) are an easy way to work with small bits of code without creating a fully fledged repository.\n\n![Gist](http:\u002F\u002Fi.imgur.com\u002FVkKI1LC.png?1)\n\nAdd `.pibb` to the end of any Gist URL ([like this](https:\u002F\u002Fgist.github.com\u002Ftiimgreen\u002F10545817.pibb)) in order to get the *HTML-only* version suitable for embedding in any other site.\n\nGists can be treated as a repository so they can be cloned like any other:\n\n```bash\n$ git clone https:\u002F\u002Fgist.github.com\u002Ftiimgreen\u002F10545817\n```\n\n![Gists](http:\u002F\u002Fi.imgur.com\u002FBcFzabp.png)\n\nThis means you also can modify and push updates to Gists:\n\n```bash\n$ git commit\n$ git push\nUsername for 'https:\u002F\u002Fgist.github.com':\nPassword for 'https:\u002F\u002Ftiimgreen@gist.github.com':\n```\n\nHowever, Gists do not support directories. All files need to be added to the repository root.\n[*Read more about creating Gists.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fcreating-gists\u002F)\n\n### Git.io\n[Git.io](http:\u002F\u002Fgit.io) is a simple URL shortener for GitHub.\n\n![Git.io](http:\u002F\u002Fi.imgur.com\u002F6JUfbcG.png?1)\n\nYou can also use it via pure HTTP using Curl:\n\n```bash\n$ curl -i http:\u002F\u002Fgit.io -F \"url=https:\u002F\u002Fgithub.com\u002F...\"\nHTTP\u002F1.1 201 Created\nLocation: http:\u002F\u002Fgit.io\u002Fabc123\n\n$ curl -i http:\u002F\u002Fgit.io\u002Fabc123\nHTTP\u002F1.1 302 Found\nLocation: https:\u002F\u002Fgithub.com\u002F...\n```\n\n[*Read more about Git.io.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F985-git-io-github-url-shortener)\n\n### Keyboard Shortcuts\nWhen on a repository page, keyboard shortcuts allow you to navigate easily.\n\n - Pressing `t` will bring up a file explorer.\n - Pressing `w` will bring up the branch selector.\n - Pressing `s` will focus the search field for the current repository. Pressing ↓ to select the “All GitHub” option changes the field to search all of GitHub.\n - Pressing `l` will edit labels on existing Issues.\n - Pressing `y` **when looking at a file** (e.g., `https:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet\u002Fblob\u002Fmaster\u002FREADME.md`) will change your URL to one which, in effect, freezes the page you are looking at. If this code changes, you will still be able to see what you saw at that current time.\n\nTo see all of the shortcuts for the current page press `?`:\n\n![Keyboard shortcuts](http:\u002F\u002Fi.imgur.com\u002Fy5ZfNEm.png)\n\n[Read more about search syntax you can use.](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fsearch-syntax\u002F)\n\n### Line Highlighting in Repositories\nEither adding, e.g., `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number.\n\nIt also works with ranges, e.g., `#L53-L60`, to select ranges, hold `shift` and click two lines:\n\n```\nhttps:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fblob\u002Fmaster\u002Factivemodel\u002Flib\u002Factive_model.rb#L53-L60\n```\n\n![Line Highlighting](http:\u002F\u002Fi.imgur.com\u002F8AhjrCz.png)\n\n### Closing Issues via Commit Messages\nIf a particular commit fixes an issue, any of the keywords `fix\u002Ffixes\u002Ffixed`, `close\u002Fcloses\u002Fclosed` or `resolve\u002Fresolves\u002Fresolved`, followed by the issue number, will close the issue once it is committed to the repository's default branch.\n\n```bash\n$ git commit -m \"Fix screwup, fixes #12\"\n```\n\nThis closes the issue and references the closing commit.\n\n![Closing Repo](http:\u002F\u002Fi.imgur.com\u002FUh1gZdx.png)\n\n[*Read more about closing Issues via commit messages.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fclosing-issues-via-commit-messages\u002F)\n\n### Cross-Link Issues\nIf you want to link to another issue in the same repository, simply type hash `#` then the issue number, and it will be auto-linked.\n\nTo link to an issue in another repository, `{user}\u002F{repo}#ISSUE_NUMBER`, e.g., `tiimgreen\u002Ftoc#12`.\n\n![Cross-Link Issues](https:\u002F\u002Fcamo.githubusercontent.com\u002F447e39ab8d96b553cadc8d31799100190df230a8\u002F68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67)\n\n### Locking Conversations\nPull Requests and Issues can now be locked by owners or collaborators of the repo.\n\n![Lock conversation](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F2723\u002F3221693\u002Fbf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png)\n\nThis means that users who are not collaborators on the project will no longer be able to comment.\n\n![Comments locked](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F2723\u002F3221775\u002Fd6e513b0-f00e-11e3-9721-2131cb37c906.png)\n\n[*Read more about locking conversations.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1847-locking-conversations)\n\n\n### CI Status on Pull Requests\nIf set up correctly, every time you receive a Pull Request, [Travis CI](https:\u002F\u002Ftravis-ci.org\u002F) will build that Pull Request just like it would every time you make a new commit. Read more about how to [get started with Travis CI](http:\u002F\u002Fdocs.travis-ci.com\u002Fuser\u002Fgetting-started\u002F).\n\n[![Travis CI status](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F1687642\u002F2700187\u002F3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https:\u002F\u002Fgithub.com\u002Foctokit\u002Foctokit.rb\u002Fpull\u002F452)\n\n[*Read more about the commit status API.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1227-commit-status-api)\n\n### Filters\n\nBoth issues and pull requests allow filtering in the user interface.\n\nFor the Rails repo: https:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fissues, the following filter is built by selecting the label \"activerecord\":\n\n`is:issue label:activerecord`\n\nBut, you can also find all issues that are NOT labeled activerecord:\n\n`is:issue -label:activerecord`\n\nAdditionally, this also works for pull requests:\n\n`is:pr -label:activerecord`\n\nGithub has tabs for displaying open or closed issues and pull requests but you\ncan also see merged pull requests.  Just put the following in the filter:\n\n`is:merged`\n\n[*Read more about searching issues.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fsearching-issues\u002F)\n\nFinally, github now allows you to filter by the Status API's status.\n\nPull requests with only successful statuses:\n\n`status:success`\n\n[*Read more about searching on the Status API.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F2014-filter-pull-requests-by-status)\n\n### Syntax Highlighting in Markdown Files\nFor example, to syntax highlight Ruby code in your Markdown files write:\n\n    ```ruby\n    require 'tabbit'\n    table = Tabbit.new('Name', 'Email')\n    table.add_row('Tim Green', 'tiimgreen@gmail.com')\n    puts table.to_s\n    ```\n\nThis will produce:\n\n```ruby\nrequire 'tabbit'\ntable = Tabbit.new('Name', 'Email')\ntable.add_row('Tim Green', 'tiimgreen@gmail.com')\nputs table.to_s\n```\n\nGitHub uses [Linguist](https:\u002F\u002Fgithub.com\u002Fgithub\u002Flinguist) to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the [languages YAML file](https:\u002F\u002Fgithub.com\u002Fgithub\u002Flinguist\u002Fblob\u002Fmaster\u002Flib\u002Flinguist\u002Flanguages.yml).\n\n[*Read more about GitHub Flavored Markdown.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fgithub-flavored-markdown\u002F)\n\n### Emojis\nEmojis can be added to Pull Requests, Issues, commit messages, repository descriptions, etc. using `:name_of_emoji:`.\n\nThe full list of supported Emojis on GitHub can be found at [emoji-cheat-sheet.com](http:\u002F\u002Fwww.emoji-cheat-sheet.com\u002F) or [scotch-io\u002FAll-Github-Emoji-Icons](https:\u002F\u002Fgithub.com\u002Fscotch-io\u002FAll-Github-Emoji-Icons).\nA handy emoji search engine can be found at [emoji.muan.co](http:\u002F\u002Femoji.muan.co\u002F).\n\nThe top 5 used Emojis on GitHub are:\n\n1. `:shipit:`\n2. `:sparkles:`\n3. `:-1:`\n4. `:+1:`\n5. `:clap:`\n\n### Images\u002FGIFs\nImages and GIFs can be added to comments, READMEs etc.:\n\n```\n![Alt Text](http:\u002F\u002Fwww.sheawong.com\u002Fwp-content\u002Fuploads\u002F2013\u002F08\u002Fkeephatin.gif)\n```\n\nRaw images from the repo can be used by calling them directly.:\n\n```\n![Alt Text](https:\u002F\u002Fgithub.com\u002F{user}\u002F{repo}\u002Fraw\u002Fmaster\u002Fpath\u002Fto\u002Fimage.gif)\n```\n\n![Peter don't care](http:\u002F\u002Fwww.sheawong.com\u002Fwp-content\u002Fuploads\u002F2013\u002F08\u002Fkeephatin.gif)\n\nAll images are cached on GitHub, so if your host goes down, the image will remain available.\n\n#### Embedding Images in GitHub Wiki\nThere are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax (shown above). But there's also a syntax that allows things like specifying the height or width of the image:\n\n```markdown\n[[ http:\u002F\u002Fwww.sheawong.com\u002Fwp-content\u002Fuploads\u002F2013\u002F08\u002Fkeephatin.gif | height = 100px ]]\n```\n\nWhich produces:\n\n![Just a screenshot](http:\u002F\u002Fi.imgur.com\u002FJ5bMf7S.png)\n\n### Quick Quoting\nWhen on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format.\n\n![Quick Quote](https:\u002F\u002Ff.cloud.github.com\u002Fassets\u002F296432\u002F124483\u002Fb0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif)\n\n[*Read more about quick quoting.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1399-quick-quotes)\n\n### Pasting Clipboard Image to Comments\n\n_(Works on Chrome browsers only)_\n\nAfter taking a screenshot and adding it to the clipboard (mac: `cmd-ctrl-shift-4`), you can simply paste (`cmd-v \u002F ctrl-v`) the image into the comment section and it will be auto-uploaded to github.\n\n![Pasting Clipboard Image to Comments](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F39191\u002F5794265\u002F39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png)\n\n[*Read more about issue attachments.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fissue-attachments\u002F)\n\n### Quick Licensing\nWhen creating a repository, GitHub gives you the option of adding in a pre-made license:\n\n![License](http:\u002F\u002Fi.imgur.com\u002FChqj4Fg.png)\n\nYou can also add them to existing repositories by creating a new file through the web interface. When the name `LICENSE` is typed in you will get an option to use a template:\n\n![License](http:\u002F\u002Fi.imgur.com\u002FfTjQict.png)\n\nAlso works for `.gitignore`.\n\n[*Read more about open source licensing.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fopen-source-licensing\u002F)\n\n### Task Lists\nIn Issues and Pull requests check boxes can be added with the following syntax (notice the space):\n\n```\n- [ ] Be awesome\n- [ ] Prepare dinner\n  - [ ] Research recipe\n  - [ ] Buy ingredients\n  - [ ] Cook recipe\n- [ ] Sleep\n```\n\n![Task List](http:\u002F\u002Fi.imgur.com\u002FjJBXhsY.png)\n\nWhen they are clicked, they will be updated in the pure Markdown:\n\n```\n- [x] Be awesome\n- [ ] Prepare dinner\n  - [x] Research recipe\n  - [x] Buy ingredients\n  - [ ] Cook recipe\n- [ ] Sleep\n```\n\n[*Read more about task lists.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fwriting-on-github\u002F#task-lists)\n\n#### Task Lists in Markdown Documents\nIn full Markdown documents **read-only** checklists can now be added using the following syntax:\n\n```\n- [ ] Mercury\n- [x] Venus\n- [x] Earth\n  - [x] Moon\n- [x] Mars\n  - [ ] Deimos\n  - [ ] Phobos\n```\n\n- [ ] Mercury\n- [x] Venus\n- [x] Earth\n  - [x] Moon\n- [x] Mars\n  - [ ] Deimos\n  - [ ] Phobos\n\n[*Read more about task lists in markdown documents.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1825-task-lists-in-all-markdown-documents)\n\n### Relative Links\nRelative links are recommended in your Markdown files when linking to internal content.\n\n```markdown\n[Link to a header](#awesome-section)\n[Link to a file](docs\u002Freadme)\n```\n\nAbsolute links have to be updated whenever the URL changes (e.g., repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own.\n\n[*Read more about relative links.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Frelative-links-in-readmes\u002F)\n\n### Metadata and Plugin Support for GitHub Pages\nWithin Jekyll pages and posts, repository information is available within the `site.github` namespace, and can be displayed, for example, using `{{ site.github.project_title }}`.\n\nThe Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](https:\u002F\u002Fgithub.com\u002Fblog\u002F821) in your Jekyll posts and pages to work just like you'd expect when interacting with a repository on GitHub.com.\n\n[*Read more about repository metadata and plugin support for GitHub Pages.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1797-repository-metadata-and-plugin-support-for-github-pages)\n\n### Viewing YAML Metadata in your Documents\nMany blogging websites, like [Jekyll](http:\u002F\u002Fjekyllrb.com\u002F) with [GitHub Pages](https:\u002F\u002Fpages.github.com), depend on some YAML-formatted metadata at the beginning of your post. GitHub will render this metadata as a horizontal table, for easier reading\n\n![YAML metadata](https:\u002F\u002Fcamo.githubusercontent.com\u002F47245aa16728e242f74a9a324ce0d24c0b916075\u002F68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67)\n\n[*Read more about viewing YAML metadata in your documents.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1647-viewing-yaml-metadata-in-your-documents)\n\n### Rendering Tabular Data\nGitHub supports rendering tabular data in the form of `.csv` (comma-separated) and `.tsv` (tab-separated) files.\n\n![Tabular data](https:\u002F\u002Fcamo.githubusercontent.com\u002F1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe\u002F68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67)\n\n[*Read more about rendering tabular data.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1601-see-your-csvs)\n\n### Rendering PDF\n\nGitHub supports rendering PDF:\n\n![PDF](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F1000669\u002F7492902\u002Ff8493160-f42e-11e4-8cea-1cb4f02757e7.png)\n\n[*Read more about rendering PDF.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1974-pdf-viewing)\n\n### Revert a Pull Request\nAfter a pull request is merged, you may find it does not help anything or it was a bad decision to merge the pull request.\n\nYou can revert it by clicking the **Revert** button on the right side of a commit in the pull request page to create a pull request with reverted changes to this specific pull request.\n\n![Revert button](https:\u002F\u002Fcamo.githubusercontent.com\u002F0d3350caf2bb1cba53123ffeafc00ca702b1b164\u002F68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67)\n\n[*Read more about reverting pull requests*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1857-introducing-the-revert-button)\n\n### Diffs\n#### Rendered Prose Diffs\nCommits and pull requests, including rendered documents supported by GitHub (e.g., Markdown), feature *source* and *rendered* views.\n\n![Source \u002F Rendered view](https:\u002F\u002Fgithub-images.s3.amazonaws.com\u002Fhelp\u002Frepository\u002Frendered_prose_diff.png)\n\nClick the \"rendered\" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text:\n\n![Rendered Prose Diffs](https:\u002F\u002Ff.cloud.github.com\u002Fassets\u002F17715\u002F2003056\u002F3997edb4-862b-11e3-90be-5e9586edecd7.png)\n\n[*Read more about rendered prose diffs.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1784-rendered-prose-diffs)\n\n#### Diffable Maps\nAny time you view a commit or pull request on GitHub that includes geodata, GitHub will render a visual representation of what was changed.\n\n[![Diffable Maps](https:\u002F\u002Ff.cloud.github.com\u002Fassets\u002F282759\u002F2090660\u002F63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https:\u002F\u002Fgithub.com\u002Fbenbalter\u002Fcongressional-districts\u002Fcommit\u002F2233c76ca5bb059582d796f053775d8859198ec5)\n\n[*Read more about diffable maps.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1772-diffable-more-customizable-maps)\n\n#### Expanding Context in Diffs\nUsing the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs.\n\n![Expanding Context in Diffs](https:\u002F\u002Ff.cloud.github.com\u002Fassets\u002F22635\u002F1610539\u002F863c1f64-5584-11e3-82bf-151b406a272f.gif)\n\n[*Read more about expanding context in diffs.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1705-expanding-context-in-diffs)\n\n#### Diff or Patch of Pull Request\nYou can get the diff of a Pull Request by adding a `.diff` or `.patch`\nextension to the end of the URL. For example:\n\n```\nhttps:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet\u002Fpull\u002F15\nhttps:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet\u002Fpull\u002F15.diff\nhttps:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet\u002Fpull\u002F15.patch\n```\n\nThe `.diff` extension would give you this in plain text:\n\n```\ndiff --git a\u002FREADME.md b\u002FREADME.md\nindex 88fcf69..8614873 100644\n--- a\u002FREADME.md\n+++ b\u002FREADME.md\n@@ -28,6 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i\n - [Merged Branches](#merged-branches)\n - [Quick Licensing](#quick-licensing)\n - [TODO Lists](#todo-lists)\n+- [Relative Links](#relative-links)\n - [.gitconfig Recommendations](#gitconfig-recommendations)\n     - [Aliases](#aliases)\n     - [Auto-correct](#auto-correct)\n@@ -381,6 +382,19 @@ When they are clicked, they will be updated in the pure Markdown:\n - [ ] Sleep\n\n(...)\n```\n\n#### Rendering and diffing images\nGitHub can display several common image formats, including PNG, JPG, GIF, and PSD. In addition, there are several ways to compare differences between versions of those image formats.\n\n[![Diffable PSD](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F2546\u002F3165594\u002F55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https:\u002F\u002Fgithub.com\u002Fblog\u002F1845-psd-viewing-diffing)\n\n[*Read more about rendering and diffing images.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Frendering-and-diffing-images\u002F)\n\n### Hub\n[Hub](https:\u002F\u002Fgithub.com\u002Fgithub\u002Fhub) is a command line Git wrapper that gives you extra features and commands that make working with GitHub easier.\n\nThis allows you to do things like:\n\n```bash\n$ hub clone tiimgreen\u002Ftoc\n```\n\n[*Check out some more cool commands Hub has to offer.*](https:\u002F\u002Fgithub.com\u002Fgithub\u002Fhub#commands)\n\n### Contribution Guidelines\nGitHub supports adding 3 different files which help users contribute to your project.\nThese files can either be placed in the root of your repository or a `.github` directory under the root.\n\n#### CONTRIBUTING File\nAdding a `CONTRIBUTING` or `CONTRIBUTING.md` file to either the root of your repository or a `.github` directory will add a link to your file when a contributor creates an Issue or opens a Pull Request.\n\n![Contributing Guidelines](https:\u002F\u002Fcamo.githubusercontent.com\u002F71995d6b0e620a9ef1ded00a04498241c69dd1bf\u002F68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067)\n\n[*Read more about contributing guidelines.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F1184-contributing-guidelines)\n\n#### ISSUE_TEMPLATE file\nYou can define a template for all new issues opened in your project. The content of this file will pre-populate the new issue box when users create new issues. Add an `ISSUE_TEMPLATE` or `ISSUE_TEMPLATE.md` file to either the root of your repository or a `.github` directory.\n\n[*Read more about issue templates.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F2111-issue-and-pull-request-templates)\n\n[Issue template file generator](https:\u002F\u002Fwww.talater.com\u002Fopen-source-templates\u002F)\n\n![GitHub Issue template](https:\u002F\u002Fcloud.githubusercontent.com\u002Fassets\u002F25792\u002F13120859\u002F733479fe-d564-11e5-8a1f-a03f95072f7a.png)\n\n#### PULL_REQUEST_TEMPLATE file\nYou can define a template for all new pull requests opened in your project. The content of this file will pre-populate the text area when users create pull requests. Add a `PULL_REQUEST_TEMPLATE` or `PULL_REQUEST_TEMPLATE.md` file to either the root of your repository or a `.github` directory.\n\n[*Read more about pull request templates.*](https:\u002F\u002Fgithub.com\u002Fblog\u002F2111-issue-and-pull-request-templates)\n\n[Pull request template file generator](https:\u002F\u002Fwww.talater.com\u002Fopen-source-templates\u002F)\n\n### Octicons\nGitHubs icons (Octicons) have now been open sourced.\n\n![Octicons](https:\u002F\u002Fog.github.com\u002Focticons\u002Focticons@1200x630.png)\n\n[*Read more about GitHub's Octicons*](https:\u002F\u002Focticons.github.com)\n\n### GitHub Student Developer Pack\n\nIf you are a student you will be eligible for the GitHub Student Developer Pack. This gives you free credit, free trials and early access to software that will help you when developing.\n\n![GitHub Student Developer Pack](http:\u002F\u002Fi.imgur.com\u002F9ru3K43.png)\n\n[*Read more about GitHub's Student Developer Pack*](https:\u002F\u002Feducation.github.com\u002Fpack)\n\n### GitHub Resources\n| Title | Link |\n| ----- | ---- |\n| GitHub Explore | https:\u002F\u002Fgithub.com\u002Fexplore |\n| GitHub Blog | https:\u002F\u002Fgithub.com\u002Fblog |\n| GitHub Help | https:\u002F\u002Fhelp.github.com\u002F |\n| GitHub Training | https:\u002F\u002Ftraining.github.com\u002F |\n| GitHub Developer | https:\u002F\u002Fdeveloper.github.com\u002F |\n| Github Education (Free Micro Account and other stuff for students) | https:\u002F\u002Feducation.github.com\u002F |\n| GitHub Best Practices | [Best Practices List](https:\u002F\u002Fwww.datree.io\u002Fresources\u002Fgithub-best-practices) |\n\n#### GitHub Talks\n| Title | Link |\n| ----- | ---- |\n| How GitHub Uses GitHub to Build GitHub | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=qyz3jkOBbQY |\n| Introduction to Git with Scott Chacon of GitHub | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ZDR433b0HJY |\n| How GitHub No Longer Works | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=gXD1ITW7iZI |\n| Git and GitHub Secrets | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=Foz9yvMkvlA |\n| More Git and GitHub Secrets | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=p50xsL-iVgU |\n\n### SSH keys\n\nYou can get a list of public ssh keys in plain text format by visiting:\n\n```\nhttps:\u002F\u002Fgithub.com\u002F{user}.keys\n```\n\ne.g. [https:\u002F\u002Fgithub.com\u002Ftiimgreen.keys](https:\u002F\u002Fgithub.com\u002Ftiimgreen.keys)\n\n[*Read more about accessing public ssh keys.*](https:\u002F\u002Fchangelog.com\u002Fgithub-exposes-public-ssh-keys-for-its-users\u002F)\n\n### Profile Image\n\nYou can get a user's profile image by visiting:\n\n```\nhttps:\u002F\u002Fgithub.com\u002F{user}.png\n```\n\ne.g. [https:\u002F\u002Fgithub.com\u002Ftiimgreen.png](https:\u002F\u002Fgithub.com\u002Ftiimgreen.png)\n\n### Repository Templates\n\nYou can enable templating on your repository which allows anyone to copy the directory structure and files, allowing them to instantly use the files (e.g. for a tutorial or if writing boilerplate code). This can be enabled in the settings of your repository.\n\n![Convert](https:\u002F\u002Fi.postimg.cc\u002FhGCrVm9F\u002FTemplate.gif)\n\nChanging to a template repository will give a new URL endpoint which can be shared and instantly allows users to use your repository as a template. Alternatively, they can go to your repository and click the 'Use as template' button.\n\n![Template](https:\u002F\u002Fi.postimg.cc\u002FL8PKCHx0\u002FNew-Template.gif)\n\n[*Read more about using repositories as templates*](https:\u002F\u002Fgithub.blog\u002F2019-06-06-generate-new-repositories-with-repository-templates\u002F)\n\n## Git\n### Remove All Deleted Files from the Working Tree\nWhen you delete a lot of files using `\u002Fbin\u002Frm` you can use the following command to remove them from the working tree and from the index, eliminating the need to remove each one individually:\n\n```bash\n$ git rm $(git ls-files -d)\n```\n\nFor example:\n\n```bash\n$ git status\nOn branch master\nChanges not staged for commit:\n\tdeleted:    a\n\tdeleted:    c\n\n$ git rm $(git ls-files -d)\nrm 'a'\nrm 'c'\n\n$ git status\nOn branch master\nChanges to be committed:\n\tdeleted:    a\n\tdeleted:    c\n```\n\n### Previous Branch\nTo move to the previous branch in Git:\n\n```bash\n$ git checkout -\n# Switched to branch 'master'\n\n$ git checkout -\n# Switched to branch 'next'\n\n$ git checkout -\n# Switched to branch 'master'\n```\n\n[*Read more about Git branching.*](http:\u002F\u002Fgit-scm.com\u002Fbook\u002Fen\u002FGit-Branching-Basic-Branching-and-Merging)\n\n### Stripspace\n\nGit Stripspace:\n\n- Strips trailing whitespace\n- Collapses newlines\n- Adds newline to end of file\n\nA file must be passed when calling the command, e.g.:\n```bash\n$ git stripspace \u003C README.md\n```\n\n[*Read more about the Git `stripspace` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-stripspace)\n\n### Checking out Pull Requests\n\nPull Requests are special branches on the GitHub repository which can be retrieved locally in several ways:\n\nRetrieve a specific Pull Request and store it temporarily in `FETCH_HEAD` for quickly `diff`-ing or `merge`-ing:\n\n```bash\n$ git fetch origin refs\u002Fpull\u002F[PR-Number]\u002Fhead\n```\n\nAcquire all Pull Request branches as local remote branches by refspec:\n\n```bash\n$ git fetch origin '+refs\u002Fpull\u002F*\u002Fhead:refs\u002Fremotes\u002Forigin\u002Fpr\u002F*'\n```\n\nOr setup the remote to fetch Pull Requests automatically by adding these corresponding lines in your repository's `.git\u002Fconfig`:\n\n```\n[remote \"origin\"]\n    fetch = +refs\u002Fheads\u002F*:refs\u002Fremotes\u002Forigin\u002F*\n    url = git@github.com:tiimgreen\u002Fgithub-cheat-sheet.git\n```\n\n```\n[remote \"origin\"]\n    fetch = +refs\u002Fheads\u002F*:refs\u002Fremotes\u002Forigin\u002F*\n    url = git@github.com:tiimgreen\u002Fgithub-cheat-sheet.git\n    fetch = +refs\u002Fpull\u002F*\u002Fhead:refs\u002Fremotes\u002Forigin\u002Fpr\u002F*\n```\n\nFor Fork-based Pull Request contributions, it's useful to `checkout` a remote branch representing the Pull Request and create a local branch from it:\n\n```bash\n$ git checkout pr\u002F42 pr-42\n```\n\nOr should you work on more repositories, you can globally configure fetching pull requests in the global git config instead.\n\n```bash\ngit config --global --add remote.origin.fetch \"+refs\u002Fpull\u002F*\u002Fhead:refs\u002Fremotes\u002Forigin\u002Fpr\u002F*\"\n```\n\nThis way, you can use the following short commands in all your repositories:\n\n```bash\ngit fetch origin\n```\n\n```bash\ngit checkout pr\u002F42\n```\n\n[*Read more about checking out pull requests locally.*](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fchecking-out-pull-requests-locally\u002F)\n\n### Empty Commits\nCommits can be pushed with no code changes by adding `--allow-empty`:\n\n```bash\n$ git commit -m \"Big-ass commit\" --allow-empty\n```\n\nSome use-cases for this (that make sense), include:\n\n - Annotating the start of a new bulk of work or a new feature.\n - Documenting when you make changes to the project that aren't code related.\n - Communicating with people using your repository.\n - The first commit of a repository: `git commit -m \"Initial commit\" --allow-empty`.\n\n### Styled Git Status\nRunning:\n\n```bash\n$ git status\n```\n\nproduces:\n\n![git status](http:\u002F\u002Fi.imgur.com\u002FqjPyvXb.png)\n\nBy adding `-sb`:\n\n```bash\n$ git status -sb\n```\n\nthis is produced:\n\n![git status -sb](http:\u002F\u002Fi.imgur.com\u002FK0OY3nm.png)\n\n[*Read more about the Git `status` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-status)\n\n### Styled Git Log\nRunning:\n\n```bash\n$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003C%an>%Creset' --abbrev-commit --date=relative\n```\n\nproduces:\n\n![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003C%an>%Creset' --abbrev-commit --date=relative](http:\u002F\u002Fi.imgur.com\u002F58eOtkW.png)\n\nCredit to [Palesz](http:\u002F\u002Fstackoverflow.com\u002Fusers\u002F88355\u002Fpalesz)\n\n*This can be aliased using the instructions found [here](https:\u002F\u002Fgithub.com\u002Ftiimgreen\u002Fgithub-cheat-sheet#aliases).*\n\n[*Read more about the Git `log` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-log)\n\n### Git Query\nA Git query allows you to search all your previous commit messages and find the most recent one matching the query.\n\n```bash\n$ git show :\u002Fquery\n```\n\nwhere `query` (case-sensitive) is the term you want to search, this then finds the last one and gives details on the lines that were changed.\n\n```bash\n$ git show :\u002Ftypo\n```\n![git show :\u002Fquery](http:\u002F\u002Fi.imgur.com\u002FicaGiNt.png)\n\n*Press `q` to quit.*\n\n\n### Git Grep\n\nGit Grep will return a list of lines matching a pattern.\n\nRunning:\n```bash\n$ git grep aliases\n```\nwill show all the files containing the string *aliases*.\n\n![git grep aliases](http:\u002F\u002Fi.imgur.com\u002FDL2zpQ9.png)\n\n*Press `q` to quit.*\n\nYou can also use multiple flags for more advanced search. For example:\n\n * `-e` The next parameter is the pattern (e.g., regex)\n * `--and`, `--or` and `--not` Combine multiple patterns.\n\nUse it like this:\n```bash\n $ git grep -e pattern --and -e anotherpattern\n```\n\n[*Read more about the Git `grep` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-grep)\n\n### Merged Branches\nRunning:\n\n```bash\n$ git branch --merged\n```\n\nwill give you a list of all branches that have been merged into your current branch.\n\nConversely:\n\n```bash\n$ git branch --no-merged\n```\n\nwill give you a list of branches that have not been merged into your current branch.\n\n[*Read more about the Git `branch` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-branch)\n\n### Fixup and Autosquash\nIf there is something wrong with a previous commit (can be one or more from HEAD), for example `abcde`, run the following command after you've amended the problem:\n```bash\n$ git commit --fixup=abcde\n$ git rebase abcde^ --autosquash -i\n```\n[*Read more about the Git `commit` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-commit)\n[*Read more about the Git `rebase` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-rebase)\n\n### Web Server for Browsing Local Repositories\nUse the Git `instaweb` command to instantly browse your working repository in `gitweb`. This command is a simple script to set up `gitweb` and a web server for browsing the local repository.\n\n```bash\n$ git instaweb\n```\n\nopens:\n\n![Git instaweb](http:\u002F\u002Fi.imgur.com\u002FDxekmqc.png)\n\n[*Read more about the Git `instaweb` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-instaweb)\n\n### Git Configurations\nYour `.gitconfig` file contains all your Git configurations.\n\n#### Aliases\nAliases are helpers that let you define your own git calls. For example you could set `git a` to run `git add --all`.\n\nTo add an alias, either navigate to `~\u002F.gitconfig` and fill it out in the following format:\n\n```\n[alias]\n  co = checkout\n  cm = commit\n  p = push\n  # Show verbose output about tags, branches or remotes\n  tags = tag -l\n  branches = branch -a\n  remotes = remote -v\n```\n\n...or type in the command-line:\n\n```bash\n$ git config --global alias.new_alias git_function\n```\n\nFor example:\n\n```bash\n$ git config --global alias.cm commit\n```\n\nFor an alias with multiple functions use quotes:\n\n```bash\n$ git config --global alias.ac 'add -A . && commit'\n```\n\nSome useful aliases include:\n\n| Alias | Command | What to Type |\n| --- | --- | --- |\n| `git cm` | `git commit` | `git config --global alias.cm commit` |\n| `git co` | `git checkout` | `git config --global alias.co checkout` |\n| `git ac` | `git add . -A` `git commit` | `git config --global alias.ac '!git add -A && git commit'` |\n| `git st` | `git status -sb` | `git config --global alias.st 'status -sb'` |\n| `git tags` | `git tag -l` | `git config --global alias.tags 'tag -l'` |\n| `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` |\n| `git cleanup` | `git branch --merged \\| grep -v '*' \\| xargs git branch -d` | `git config --global alias.cleanup \"!git branch --merged \\| grep -v '*' \\| xargs git branch -d\"` |\n| `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` |\n| `git lg` | `git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003C%an>%Creset' --abbrev-commit --` | `git config --global alias.lg \"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)\u003C%an>%Creset' --abbrev-commit --\"` |\n\n*Some Aliases are taken from [@mathiasbynens](https:\u002F\u002Fgithub.com\u002Fmathiasbynens) dotfiles: https:\u002F\u002Fgithub.com\u002Fmathiasbynens\u002Fdotfiles\u002Fblob\u002Fmaster\u002F.gitconfig*\n\n#### Auto-Correct\nGit gives suggestions for misspelled commands and if auto-correct is enabled the command can be fixed and executed automatically. Auto-correct is enabled by specifying an integer which is the delay in tenths of a second before git will run the corrected command. Zero is the default value where no correcting will take place, and a negative value will run the corrected command with no delay.\n\nFor example, if you type `git comit` you will get this:\n\n```bash\n$ git comit -m \"Message\"\n# git: 'comit' is not a git command. See 'git --help'.\n\n# Did you mean this?\n#   commit\n```\n\nAuto-correct can be enabled like this (with a 1.5 second delay):\n\n```bash\n$ git config --global help.autocorrect 15\n```\n\nSo now the command `git comit` will be auto-corrected to `git commit` like this:\n\n```bash\n$ git comit -m \"Message\"\n# WARNING: You called a Git command named 'comit', which does not exist.\n# Continuing under the assumption that you meant 'commit'\n# in 1.5 seconds automatically...\n```\n\nThe delay before git will rerun the command is so the user has time to abort.\n\n#### Color\nTo add more color to your Git output:\n\n```bash\n$ git config --global color.ui 1\n```\n\n[*Read more about the Git `config` command.*](http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgit-config)\n\n### Git Resources\n| Title | Link |\n| ----- | ---- |\n| Official Git Site | http:\u002F\u002Fgit-scm.com\u002F |\n| Official Git Video Tutorials | http:\u002F\u002Fgit-scm.com\u002Fvideos |\n| Code School Try Git | http:\u002F\u002Ftry.github.com\u002F |\n| Introductory Reference & Tutorial for Git | http:\u002F\u002Fgitref.org\u002F |\n| Official Git Tutorial | http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Fgittutorial |\n| Everyday Git | http:\u002F\u002Fgit-scm.com\u002Fdocs\u002Feveryday |\n| Git Immersion | http:\u002F\u002Fgitimmersion.com\u002F |\n| Git God | https:\u002F\u002Fgithub.com\u002Fgorosgobe\u002Fgit-god |\n| Git for Computer Scientists | http:\u002F\u002Feagain.net\u002Farticles\u002Fgit-for-computer-scientists\u002F |\n| Git Magic | http:\u002F\u002Fwww-cs-students.stanford.edu\u002F~blynn\u002Fgitmagic\u002F |\n| Git Visualization Playground | http:\u002F\u002Fonlywei.github.io\u002Fexplain-git-with-d3\u002F#freeplay |\n| Learn Git Branching | http:\u002F\u002Fpcottle.github.io\u002FlearnGitBranching\u002F |\n| A collection of useful .gitignore templates | https:\u002F\u002Fgithub.com\u002Fgithub\u002Fgitignore |\n| Unixorn's git-extra-commands collection of git scripts | https:\u002F\u002Fgithub.com\u002Funixorn\u002Fgit-extra-commands |\n\n#### Git Books\n| Title | Link |\n| ----- | ---- |\n| Pragmatic Version Control Using Git | https:\u002F\u002Fpragprog.com\u002Ftitles\u002Ftsgit\u002Fpragmatic-version-control-using-git |\n| Pro Git | http:\u002F\u002Fgit-scm.com\u002Fbook |\n| Git Internals PluralSight | https:\u002F\u002Fgithub.com\u002Fpluralsight\u002Fgit-internals-pdf |\n| Git in the Trenches | http:\u002F\u002Fcbx33.github.io\u002Fgitt\u002F |\n| Version Control with Git | http:\u002F\u002Fwww.amazon.com\u002FVersion-Control-Git-collaborative-development\u002Fdp\u002F1449316387 |\n| Pragmatic Guide to Git | https:\u002F\u002Fpragprog.com\u002Ftitles\u002Fpg_git\u002Fpragmatic-guide-to-git |\n| Git: Version Control for Everyone | https:\u002F\u002Fwww.packtpub.com\u002Fapplication-development\u002Fgit-version-control-everyone |\n\n#### Git Videos\n| Title | Link |\n| ----- | ---- |\n| Linus Torvalds on Git | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=4XpnKHJAok8 |\n| Introduction to Git with Scott Chacon | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ZDR433b0HJY |\n| Git From the Bits Up | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=MYP56QJpDr4 |\n| Graphs, Hashes, and Compression, Oh My! | https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=ig5E8CcdM9g |\n| GitHub Training & Guides | https:\u002F\u002Fwww.youtube.com\u002Fwatch?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-&v=FyfwLX4HAxM |\n\n#### Git Articles\n| Title | Link |\n| ----- | ---- |\n| GitHub Flow  | http:\u002F\u002Fscottchacon.com\u002F2011\u002F08\u002F31\u002Fgithub-flow.html |\n| Migrating to Git Large File Storate (Git LFS) | http:\u002F\u002Fvooban.com\u002Fen\u002Ftips-articles-geek-stuff\u002Fmigrating-to-git-lfs-for-developing-deep-learning-applications-with-large-files\u002F |\n","GitHub Cheat Sheet 是一个收集了 Git 和 GitHub 中隐藏及非隐藏特性的列表。该项目的核心功能包括提供一系列实用技巧，如忽略空白字符、调整制表符间距、按作者查看提交历史等，帮助用户更高效地使用 Git 和 GitHub。技术特点在于其内容丰富且持续更新，覆盖从基础到高级的各种操作，并支持多种语言版本。适用于任何希望提高 Git 和 GitHub 使用效率的开发者或团队，在日常开发、代码审查以及项目管理中都能发挥重要作用。",2,"2026-06-11 02:37:43","top_all"]