├── spec ├── positioner_spec.ts ├── helpers │ └── dependencies.js ├── support │ └── jasmine.json └── base_spec.mjs ├── babel.config.json ├── images ├── 75572.png ├── graph.jpg ├── graph3.gif ├── vRice.jpg ├── vCanvas.jpg ├── 10GraphSMA.jpg ├── vLegalPad.jpg ├── legal_pad_23.jpg ├── tn_graphpaper.gif └── tn_notepaper.gif ├── .travis.yml ├── git-cheatsheet ├── images │ └── vCanvas.jpg ├── fonts │ └── Impact-Label-fontfacekit │ │ ├── Impact_label-webfont.eot │ │ ├── Impact_label-webfont.ttf │ │ ├── Impact_label-webfont.woff │ │ ├── Impact_label_reversed-webfont.eot │ │ ├── Impact_label_reversed-webfont.ttf │ │ ├── Impact_label_reversed-webfont.woff │ │ ├── stylesheet.css │ │ ├── Tension Type Font License.txt │ │ └── demo.html └── lang │ ├── zh-cn.json │ ├── zh-tw.json │ ├── ko.json │ ├── es.json │ ├── de.json │ ├── fr.json │ ├── it.json │ ├── pt.json │ ├── vi.json │ ├── en.json │ └── ru.json ├── Dockerfile ├── .gitignore ├── .editorconfig ├── git-cheatsheet.htm ├── .yarnrc.yml ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ └── node.js.yml ├── src ├── cookies.mjs ├── base.mjs ├── lib │ ├── 1200.css │ └── csster.js ├── commands.mjs ├── build-styles.js └── git-cheatsheet.js ├── LICENSE.txt ├── package.json ├── .circleci └── config.yml └── README.md /spec/positioner_spec.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /images/75572.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/75572.png -------------------------------------------------------------------------------- /images/graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/graph.jpg -------------------------------------------------------------------------------- /images/graph3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/graph3.gif -------------------------------------------------------------------------------- /images/vRice.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/vRice.jpg -------------------------------------------------------------------------------- /images/vCanvas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/vCanvas.jpg -------------------------------------------------------------------------------- /images/10GraphSMA.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/10GraphSMA.jpg -------------------------------------------------------------------------------- /images/vLegalPad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/vLegalPad.jpg -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | - "12" 5 | - "14" 6 | - "node" 7 | -------------------------------------------------------------------------------- /images/legal_pad_23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/legal_pad_23.jpg -------------------------------------------------------------------------------- /images/tn_graphpaper.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/tn_graphpaper.gif -------------------------------------------------------------------------------- /images/tn_notepaper.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/images/tn_notepaper.gif -------------------------------------------------------------------------------- /git-cheatsheet/images/vCanvas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/images/vCanvas.jpg -------------------------------------------------------------------------------- /spec/helpers/dependencies.js: -------------------------------------------------------------------------------- 1 | global.navigator = { 2 | userAgent: 'test-chrome' 3 | } 4 | global.document = { cookie: '' } 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-alpine 2 | RUN corepack enable 3 | WORKDIR /app 4 | COPY . . 5 | RUN yarn install 6 | EXPOSE 8080 7 | CMD ["yarn", "start"] 8 | -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label-webfont.eot -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label-webfont.ttf -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label-webfont.woff -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label_reversed-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label_reversed-webfont.eot -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label_reversed-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label_reversed-webfont.ttf -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label_reversed-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ndp/git-cheatsheet/HEAD/git-cheatsheet/fonts/Impact-Label-fontfacekit/Impact_label_reversed-webfont.woff -------------------------------------------------------------------------------- /spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.js" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /git-cheatsheet/*.js 3 | /git-cheatsheet/*.map 4 | git-cheatsheet/styles.css 5 | git-cheatsheet/main.js.LICENSE.txt 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/sdks 12 | !.yarn/versions 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig 2 | # See: http://EditorConfig.org 3 | 4 | # top-most EditorConfig file 5 | root = true 6 | 7 | # Set default charset 8 | [*.{js,mjs,py,rb,erb}] 9 | charset = utf-8 10 | 11 | [*] 12 | end_of_line = lf 13 | indent_style = space 14 | indent_size = 2 15 | trim_trailing_whitespace = true 16 | insert_final_newline = true 17 | -------------------------------------------------------------------------------- /git-cheatsheet.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Interactive Git Cheatsheet redirect 4 | 5 | 6 | 7 | Redirecting to https://ndpsoftware.com/git-cheatsheet.html. 8 | 9 | 10 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | plugins: 4 | - path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs 5 | spec: "https://mskelton.dev/yarn-outdated/v2" 6 | - path: .yarn/plugins/@yarnpkg/plugin-version.cjs 7 | spec: "@yarnpkg/plugin-version" 8 | - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs 9 | spec: "@yarnpkg/plugin-typescript" 10 | 11 | yarnPath: .yarn/releases/yarn-3.2.1.cjs 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /src/cookies.mjs: -------------------------------------------------------------------------------- 1 | export const cookies = { 2 | create: function (name, value) { 3 | setTimeout(() => { 4 | // Run in a different thread so exceptions are reported but 5 | // don't interrupt flow. 6 | document.cookie = name + "=" + value + "; path=/" 7 | }, 0) 8 | }, 9 | read: function (name) { 10 | const nameEQ = name + "=" 11 | let ca 12 | try { 13 | ca = document.cookie.split(';') 14 | } catch (e) { 15 | return null 16 | } 17 | 18 | for (let i = 0; i < ca.length; i++) { 19 | let c = ca[i] 20 | while (c.charAt(0) == ' ') { 21 | c = c.substring(1, c.length) 22 | } 23 | if (c.indexOf(nameEQ) === 0) { 24 | return c.substring(nameEQ.length, c.length) 25 | } 26 | } 27 | return null 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on November 23, 2010 01:59:24 AM America/New_York */ 2 | 3 | 4 | 5 | @font-face { 6 | font-family: 'ImpactLabelRegular'; 7 | src: url('Impact_label-webfont.eot'); 8 | src: local('☺'), url('Impact_label-webfont.woff') format('woff'), url('Impact_label-webfont.ttf') format('truetype'), url('Impact_label-webfont.svg#webfont4r1DatUq') format('svg'); 9 | font-weight: normal; 10 | font-style: normal; 11 | } 12 | 13 | @font-face { 14 | font-family: 'ImpactLabelReversedRegular'; 15 | src: url('Impact_label_reversed-webfont.eot'); 16 | src: local('☺'), url('Impact_label_reversed-webfont.woff') format('woff'), url('Impact_label_reversed-webfont.ttf') format('truetype'), url('Impact_label_reversed-webfont.svg#webfont6oy8XCTs') format('svg'); 17 | font-weight: normal; 18 | font-style: normal; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /.github/workflows/node.js.yml: -------------------------------------------------------------------------------- 1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs 3 | 4 | name: Node.js CI 5 | 6 | on: 7 | push: 8 | branches: [ "master" ] 9 | pull_request: 10 | branches: [ "master" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | strategy: 18 | matrix: 19 | node-version: [18.x] 20 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v3 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | cache: 'npm' 29 | - run: yarn 30 | - run: yarn test 31 | - run: yarn build 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2022 Andrew J. Peterson, NDP Software 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | associated documentation files (the "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial 12 | portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 17 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /src/base.mjs: -------------------------------------------------------------------------------- 1 | import { cookies } from './cookies.mjs' 2 | 3 | // Return value after `val` in the array `a`, looping around 4 | export function next(a, val) { 5 | var index = a.indexOf(val); 6 | return index == -1 || index == (a.length - 1) ? a[0] : a[index + 1]; 7 | } 8 | 9 | // Return value before `val` in the array `a`, looping around 10 | export function prev(a, val) { 11 | var index = a.indexOf(val); 12 | return index <= 0 ? a[a.length - 1] : a[index - 1]; 13 | } 14 | 15 | /* 16 | Escape the string in an app-specific way: 17 | become x 18 | [x] becomes x 19 | `x` becomes x 20 | \r becomes
21 | */ 22 | export function esc(s) { 23 | return s 24 | .replace(//g, '') 26 | .replace(/zyx/g, '') 27 | .replace(/\[/g, '') 28 | .replace(/]/g, '') 29 | .replace(/`(.*?)`/g, '' + "$1" + '') 30 | .replace(/\r/g, '
'); 31 | } 32 | 33 | // Return a two charact language code 34 | export function detectLanguage(/*pass in navi*/gator) { 35 | return cookies.read('lang') || 36 | (cookies.read('language') || 37 | gator.language || 38 | gator.userLanguage || 39 | 'en').slice(0, 2) 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "browserslist": "> 0.05%, not dead", 3 | "name": "git-cheatsheet", 4 | "version": "1.0.0", 5 | "description": "Git Cheatsheet", 6 | "main": "git-cheatsheet.html", 7 | "scripts": { 8 | "build": "yarn build-js && yarn build-styles", 9 | "build-js": "webpack --entry ./src/git-cheatsheet.js -o ./git-cheatsheet/ --mode production --target browserslist --devtool source-map", 10 | "build-styles": "node ./src/build-styles.js", 11 | "docker-build": "docker build -t git-cheatsheet .", 12 | "docker-run": "docker run -p 8080:8080 git-cheatsheet", 13 | "clean": "rm -f git-cheatsheet/*.map git-cheatsheet/*.js ./git-cheatsheet/styles.css", 14 | "test": "jasmine spec/*_spec.mjs", 15 | "start": "npx http-server", 16 | "start-docker": "npm run docker-build && npm run docker-run" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/ndp/git-cheatsheet.git" 21 | }, 22 | "author": "Andrew J. Peterson / NDP Software", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/ndp/git-cheatsheet/issues" 26 | }, 27 | "homepage": "https://github.com/ndp/git-cheatsheet#readme", 28 | "devDependencies": { 29 | "@babel/cli": "^7.24.8", 30 | "@babel/core": "^7.24.9", 31 | "@babel/preset-env": "^7.24.8", 32 | "browserlist": "*", 33 | "jasmine": "^5.1.0", 34 | "jquery": "^3.7.1", 35 | "webpack": "^5.94.0", 36 | "webpack-cli": "^5.1.4" 37 | }, 38 | "packageManager": "yarn@3.2.1" 39 | } 40 | -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/Tension Type Font License.txt: -------------------------------------------------------------------------------- 1 | By downloading and/or installing a Tension Type Free Font you agree to this licence: 2 | 3 | This Tension Type Free Font is free to use in any and all of your personal and commercial work. 4 | 5 | A donation is much appreciated, but not necessary (donations may be done through PayPal to: mtension@gmail.com). No donation is too small. 6 | 7 | You may install and use an unlimited number of copies of a Tension Type Free Font. 8 | 9 | Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of a Tension Type Free Font; provided that each copy shall be a true and complete copy, including all copyright and trademark notices (if applicable), and shall be accompanied by a copy of this text file. Copies of the Font may not be distributed for profit either on a standalone basis or included as part of your own product unless by prior permission of Tension Type. 10 | 11 | You may not rename, edit or create any derivative works from a Tension Type Free Font, other than subsetting when embedding them in documents unless you have permission from Tension Type. 12 | 13 | Embedding a Tension Type Free Font in a PDF document and web pages is allowed. 14 | 15 | Michael Tension and Tension Type are not responsible for any damage resulting from the use of this Tension Type Free Font. 16 | 17 | Any questions, or if you wish to share your designs, please contact Michael Tension: mtension@gmail.com 18 | 19 | Thanks a ton, 20 | Michael Tension -------------------------------------------------------------------------------- /git-cheatsheet/fonts/Impact-Label-fontfacekit/demo.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | Font Face Demo 9 | 10 | 22 | 23 | 24 | 25 |
26 |

FONT-FACE DEMO FOR THE IMPACT LABEL FONT

27 | 28 | 29 | 30 |

Impact Label Regular - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

31 | 32 | 33 | 34 |

Impact Label Reversed Regular - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Use the latest 2.1 version of CircleCI pipeline process engine. 2 | # See: https://circleci.com/docs/2.0/configuration-reference 3 | version: 2.1 4 | 5 | orbs: 6 | # The Node.js orb contains a set of prepackaged CircleCI configuration you can utilize 7 | # Orbs reduce the amount of configuration required for common tasks. 8 | # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/node 9 | node: circleci/node@5.0.1 10 | 11 | jobs: 12 | 13 | build-and-test-node-15: 14 | # These next lines define a docker executor: https://circleci.com/docs/2.0/executor-types/ 15 | # You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. 16 | # A list of available CircleCI docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/node 17 | docker: 18 | - image: cimg/node:15.1 19 | # Then run your tests! 20 | # CircleCI will report the results back to your VCS provider. 21 | steps: 22 | - checkout 23 | - node/install-packages: 24 | pkg-manager: yarn-berry 25 | - run: 26 | name: Build 27 | command: yarn build 28 | - run: 29 | name: Run tests 30 | command: yarn test 31 | 32 | build-and-test-node-16: 33 | # These next lines define a docker executor: https://circleci.com/docs/2.0/executor-types/ 34 | # You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. 35 | # A list of available CircleCI docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/node 36 | docker: 37 | - image: cimg/node:16.5 38 | # Then run your tests! 39 | # CircleCI will report the results back to your VCS provider. 40 | steps: 41 | - checkout 42 | - node/install-packages: 43 | pkg-manager: yarn-berry 44 | - run: 45 | name: Build 46 | command: yarn build 47 | - run: 48 | name: Run tests 49 | command: yarn test 50 | 51 | workflows: 52 | # For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows 53 | run-tests: 54 | jobs: 55 | - build-and-test-node-15 56 | - build-and-test-node-16 57 | # For running simple node tests, you could optionally use the node/test job from the orb to replicate and replace the job above in fewer lines. 58 | # - node/test 59 | -------------------------------------------------------------------------------- /src/lib/1200.css: -------------------------------------------------------------------------------- 1 | /* Containers 2 | ----------------------------------------------------------------------------------------------------*/ 3 | .container_16 { 4 | margin-left: 20px; 5 | margin-right: auto; 6 | min-width: 1200px; 7 | display: flex; 8 | flex-direction: row; 9 | flex-wrap: nowrap; 10 | justify-content: flex-start; 11 | align-items: flex-start; 12 | } 13 | 14 | /* Grid >> Children (Alpha ~ First, Omega ~ Last) 15 | ----------------------------------------------------------------------------------------------------*/ 16 | 17 | .alpha { 18 | margin-left: 0 !important; 19 | } 20 | 21 | .omega { 22 | margin-right: 0 !important; 23 | } 24 | 25 | 26 | 27 | /* Grid >> Global 28 | ----------------------------------------------------------------------------------------------------*/ 29 | 30 | .grid_1, 31 | .grid_2, 32 | .grid_3, 33 | .grid_4, 34 | .grid_5, 35 | .grid_6, 36 | .grid_7, 37 | .grid_8, 38 | .grid_9, 39 | .grid_10, 40 | .grid_11, 41 | .grid_12, 42 | .grid_13, 43 | .grid_14, 44 | .grid_15, 45 | .grid_16{ 46 | display:block; 47 | position: relative; 48 | margin-left: 10.0px; 49 | margin-right: 10.0px; 50 | } 51 | 52 | 53 | /* Grid >> 2 Columns 54 | ----------------------------------------------------------------------------------------------------*/ 55 | 56 | .container_16 .grid_1{ 57 | flex-grow: 1; 58 | min-width:55px; 59 | } 60 | 61 | .container_16 .grid_2{ 62 | flex-grow: 2; 63 | min-width:130px; 64 | } 65 | 66 | .container_16 .grid_3{ 67 | flex-grow: 3; 68 | min-width:205px; 69 | } 70 | 71 | .container_16 .grid_4{ 72 | flex-grow: 4; 73 | min-width:280px; 74 | } 75 | 76 | .container_16 .grid_5{ 77 | flex-grow: 5; 78 | min-width:355px; 79 | } 80 | 81 | .container_16 .grid_6{ 82 | flex-grow: 6; 83 | min-width:430px; 84 | } 85 | 86 | .container_16 .grid_7{ 87 | flex-grow: 7; 88 | /*min-width:505px;*/ 89 | } 90 | 91 | .container_16 .grid_8{ 92 | flex-grow: 8; 93 | /*min-width:580px;*/ 94 | } 95 | 96 | .container_16 .grid_9{ 97 | flex-grow: 9; 98 | min-width:655px; 99 | } 100 | 101 | .container_16 .grid_10{ 102 | flex-grow: 10; 103 | min-width:730px; 104 | } 105 | 106 | .container_16 .grid_11{ 107 | flex-grow: 11; 108 | min-width:805px; 109 | } 110 | 111 | .container_16 .grid_12{ 112 | flex-grow: 12; 113 | min-width:880px; 114 | } 115 | 116 | .container_16 .grid_13{ 117 | flex-grow: 13; 118 | min-width:955px; 119 | } 120 | 121 | .container_16 .grid_14{ 122 | flex-grow: 14; 123 | min-width:1030px; 124 | } 125 | 126 | .container_16 .grid_15{ 127 | flex-grow: 15; 128 | min-width:1105px; 129 | } 130 | 131 | .container_16 .grid_16{ 132 | flex-grow: 16; 133 | min-width:1180px; 134 | } 135 | 136 | 137 | /* Clear Floated Elements 138 | ----------------------------------------------------------------------------------------------------*/ 139 | 140 | 141 | .clear { 142 | clear: both; 143 | display: block; 144 | overflow: hidden; 145 | visibility: hidden; 146 | width: 0; 147 | height: 0; 148 | } 149 | -------------------------------------------------------------------------------- /spec/base_spec.mjs: -------------------------------------------------------------------------------- 1 | import { 2 | detectLanguage, 3 | next, 4 | prev, 5 | esc 6 | } from '../src/base.mjs' 7 | import { 8 | cookies 9 | } from '../src/cookies.mjs' 10 | 11 | describe('git cheatsheet / base', function () { 12 | describe('next()', function () { 13 | it('returns first item in list if nothing selected', function () { 14 | expect(next(['A','B','C'], null)).toEqual('A'); 15 | }); 16 | it('returns second item in list if first item sent', function () { 17 | expect(next(['A','B','C'], 'A')).toEqual('B'); 18 | }); 19 | it('returns next item in list if middle item sent', function () { 20 | expect(next(['A','B','C'], 'B')).toEqual('C'); 21 | }); 22 | it('returns first item in list if last item sent', function () { 23 | expect(next(['A','B','C'], 'C')).toEqual('A'); 24 | }); 25 | }); 26 | 27 | describe('prev()', function () { 28 | it('returns last item in list if nothing selected', function () { 29 | expect(prev(['A','B','C'], null)).toEqual('C'); 30 | }); 31 | it('returns penultimate item in list if last item sent', function () { 32 | expect(prev(['A','B','C'], 'C')).toEqual('B'); 33 | }); 34 | it('returns prev item in list if middle item sent', function () { 35 | expect(prev(['A','B','C'], 'B')).toEqual('A'); 36 | }); 37 | it('returns last item in list if first item sent', function () { 38 | expect(prev(['A','B','C'], 'A')).toEqual('C'); 39 | }); 40 | }); 41 | 42 | describe('esc', function() { 43 | it('replaces cr with
', function() { 44 | expect(esc('foo\rbar')).toEqual('foo
bar') 45 | }) 46 | it('replaces with ', function() { 47 | expect(esc('foo baz')).toEqual('foo bar baz') 48 | }) 49 | it('replaces [x] with ', function() { 50 | expect(esc('foo [bar] baz')).toEqual('foo bar baz') 51 | }) 52 | it('replaces multiple [x]s with s', function() { 53 | expect(esc('foo [bar] baz [bat]')).toEqual('foo bar baz bat') 54 | }) 55 | it('replaces `x=3` with ', function() { 56 | expect(esc('foo `x=3` baz')).toEqual('foo x=3 baz') 57 | expect(esc('foo `x=3` baz `y=5`')).toEqual('foo x=3 baz y=5') 58 | }) 59 | }); 60 | 61 | describe('detectLanguage', function() { 62 | const navigator = {} 63 | it('looks at navigation', function() { 64 | navigator.language = 'fr-FR' 65 | expect(detectLanguage(navigator)).toEqual('fr') 66 | }) 67 | it('cookie can override', function() { 68 | navigator.language = 'fr-FR' 69 | cookies.read = () => 'de' 70 | try { 71 | expect(detectLanguage(navigator)).toEqual('de') 72 | } finally { 73 | cookies.read = () => null 74 | } 75 | }) 76 | it('works for IE', function() { 77 | navigator.language = undefined 78 | navigator.userLanguage = 'fr-FR' 79 | expect(detectLanguage(navigator)).toEqual('fr') 80 | }) 81 | it('works with nil', function() { 82 | navigator.language = undefined 83 | navigator.userLanguage = undefined 84 | expect(detectLanguage(navigator)).toEqual('en') 85 | }) 86 | }) 87 | 88 | }); 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Cheatsheet 2 | 3 |
4 | screenshot of app 5 |
6 | 7 | Standalone HTML page that organizes Git's commands by what they affect. 8 | Built as I was learning git and trying to understand it. It's proved useful 9 | to others in the same endeavor. 10 | 11 | ## Contributors 12 | 13 | * Development by Andrew Peterson, [NDP Software](https://ndpsoftware.com) 14 | * French translation by [Bernard Opic](https://blogs.media-tips.com/bernard.opic/) 15 | * Simplified Chinese translation by [acecode](https://github.com/acecode) 16 | * Improve Simplified Chinese translation by [rebornsick](https://github.com/rebornsick) 17 | * Traditional Chinese translation by [Hsins](https://github.com/Hsins) 18 | * Bug fix by [GerjanOnline](https://github.com/GerjanOnline) 19 | * Spanish translation by [sminutoli](https://github.com/sminutoli) 20 | * Korean translation by [ujuc](https://github.com/ujuc) 21 | * Italian translation by [antoniopantaleo](https://github.com/antoniopantaleo) 22 | * Vietnamese translation by [trgiangdo](https://github.com/trgiangdo) 23 | * Portuguese translation by [HenriqueAJNB](https://github.com/HenriqueAJNB) 24 | * Russian translation by [vistar](https://github.com/vistar) 25 | 26 | Comments and pull requests welcome. 27 | 28 | ## To add a translation 29 | 30 | 1. Determine the 2-letter language code (ISO 639-1). See the existing files in `git-cheatsheet/lang`. 31 | 2. Create a new JSON file with the name of the code in `git-cheatsheet/lang`. Choose one of the other languages as a starting point. 32 | 3. Write your translation. Use the exact identical property keys in the JSON structure. Only change the values. 33 | 4. Add a link for users to choose the translation. In `git-cheatsheet.html`, insert (alphabetically) a new line that looks like: 34 | ``` 35 | vn 36 | ``` 37 | 5. Add your name to the README.md above. 38 | 6. Test manually 39 | 7. Create a pull request. Give me a couple days to reply, but then feel free to write. 40 | 8. Once it's merged, tell people about it. 41 | 42 | Keep the PR restricted to changes related to the translation. 43 | 44 | 45 | ## Development 46 | 47 | Files are in the `src` folder. To see it locally: 48 | - `yarn install` to install dependencies 49 | - `yarn test` to run the tests 50 | - `yarn build` to transpile. 51 | - `yarn start` or `yarn start-docker` to serve. The latter uses a Docker container. 52 | - Open `http://127.0.0.1:8080/git-cheatsheet.html` to view the page 53 | 54 | CI is on [Github Actions](https://github.com/ndp/git-cheatsheet/actions). 55 | 56 | ## Deploy 57 | 58 | ### Legacy 59 | Use FTP to upload to [NDP Software](http://www.ndpsoftware.com/) 60 | 61 | Exceptions caught and logged on [Rollbar](https://rollbar.com/ndpsoftware/git-cheatsheet/) (private). 62 | 63 | ### AWS Deployment 64 | 65 | ```bash 66 | rsync --progress -e "ssh -i ~/.ssh/LightsailDefaultKey-us-west-2.pem" ./git-cheatsheet.htm bitnami@52.36.92.53:/home/bitnami/htdocs/ 67 | 68 | rsync --progress -e "ssh -i ~/.ssh/LightsailDefaultKey-us-west-2.pem" ./git-cheatsheet.html bitnami@52.36.92.53:/home/bitnami/htdocs/ 69 | 70 | rsync -avcz --progress -e "ssh -i ~/.ssh/LightsailDefaultKey-us-west-2.pem" ./git-cheatsheet bitnami@52.36.92.53:/home/bitnami/htdocs/ 71 | 72 | rsync -avcz --progress -e "ssh -i ~/.ssh/LightsailDefaultKey-us-west-2.pem" ../agile_methods bitnami@52.36.92.53:/home/bitnami/htdocs/ 73 | 74 | 75 | ``` 76 | 77 | ## FAQ 78 | 79 | ### Are there any "features"? 80 | 81 | You can navigate over different "locations" and commands with the mouse, arrow keys, or vi-like keystrokes. 82 | 83 | ### Why is it called "Cheat Sheet"? 84 | 85 | It's pretty silly, actually. I had a little SEO juice from a couple other real cheat sheets, 86 | so I thought I'd just leverage that term. In retrospect, I think this was an 87 | okay tactic, as it brought people to the page. 88 | 89 | ## Like it or have ideas? 90 | 91 | If you like this and would like me to do more intereactions like this, send me an email... or [patreon.com/ndp](https://patreon.com/ndp) 92 | 93 | ## License 94 | 95 | Copyright (c) 2013-2024 Andrew J. Peterson, NDP Software 96 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": { 3 | "status": { 4 | "cmd": "status", 5 | "docs": "显示以下文件的状态变化和路径:\r• 暂存区与当前的 `HEAD` 指针提交之间的差异(即将提交),\r• 工作区与暂存区之间的差异(下次不会提交),\r• 没有被 git 追踪。" 6 | }, 7 | "diff": { 8 | "cmd": "diff", 9 | "docs": "显示工作区与暂存区之间的差异。" 10 | }, 11 | "diff x": { 12 | "cmd": "diff ", 13 | "docs": "查看工作区与某一提交之间的不同。你也可以使用 `HEAD` 指针来对比最新提交,或是使用分支名来和分支进行比较。" 14 | }, 15 | "add x": { 16 | "cmd": "add ", 17 | "docs": "添加当前的新内容或是修改的文件到暂存区,作为下次提交的部分内容。使用 `add --interactive` 进行交互式操作将工作区中修改的内容添加到暂存区中。" 18 | }, 19 | "add -u": { 20 | "cmd": "add -u", 21 | "docs": "添加当前修改(`不包括新文件`)到暂存区, 这与 'git commit -a' 准备提交内容的方式一致。" 22 | }, 23 | "rm x": { 24 | "cmd": "rm ", 25 | "docs": "从工作区和暂存区删除某个文件。" 26 | }, 27 | "mv x": { 28 | "cmd": "mv ", 29 | "docs": "从工作区和暂存区移动文件。" 30 | }, 31 | "commit -a": { 32 | "cmd": "commit -a [-m 'msg']", 33 | "docs": "提交上次提交之后的所有修改,但未被追踪的文件除外(即所有已在暂存区中列出的文件),同时删除暂存区中已从工作区中删除的文件。" 34 | }, 35 | "checkout x": { 36 | "cmd": "checkout ", 37 | "docs": "更新工作区文件或文件夹,`不会`切换分支。" 38 | }, 39 | "reset head x": { 40 | "cmd": "reset HEAD ", 41 | "docs": "从下次提交中移除指定文件。重置暂存区记录但是不处理工作区(即文件修改被保留但不会被提交),同时报告没有被更新的文件。" 42 | }, 43 | "reset --soft head^": { 44 | "cmd": "reset --soft HEAD^", 45 | "docs": "撤销上一次提交,以未提交的状态保留工作区的修改。完全不会修改暂存区文件或工作区,唯一的更改是移动本地仓库的指针。" 46 | }, 47 | "reset --hard": { 48 | "cmd": "reset --hard", 49 | "docs": "恢复工作区和暂存区到上次提交的状态。警告:所有工作区修改都会丢失。如果你想从头开始的话,使用这条命令来解决合并错误。传入 `ORIG_HEAD` 来撤销该次提交以来的所有修改。" 50 | }, 51 | "switch": { 52 | "cmd": "switch ", 53 | "docs": "切换分支,更改工作区和暂存区为 分支的内容,之后 `HEAD` 指向 分支。" 54 | }, 55 | "checkout -b x": { 56 | "cmd": "checkout -b ", 57 | "docs": "新建一个分支并且立即切换过去。" 58 | }, 59 | "merge x": { 60 | "cmd": "merge ", 61 | "docs": "从 分支合并到当前分支。\r使用 `‑‑no-commit` 可以保持在(已经合并)但未提交状态。\r使用 `--no-ff` 创建一个合并提交,即使合并被解析为快进。" 62 | }, 63 | "rebase x": { 64 | "cmd": "rebase ", 65 | "docs": "回滚当前分支与 `` 分支分开处的所有提交记录,将这些提交一一应用到 `` 分支的 `HEAD` 作为新的提交记录。" 66 | }, 67 | "cherry-pick x": { 68 | "cmd": "cherry-pick ", 69 | "docs": "整合选定提交的修改到当前分支。" 70 | }, 71 | "revert x": { 72 | "cmd": "revert ", 73 | "docs": "回滚 指定的提交并提交结果。这需要当前工作区是干净的,即相比于 `HEAD` 提交没有修改。" 74 | }, 75 | "diff --cached": { 76 | "cmd": "diff --cached []", 77 | "docs": "查看已经暂存的内容和上次提交的区别。可通过 指定某一提交。" 78 | }, 79 | "commit": { 80 | "cmd": "commit [-m 'msg']", 81 | "docs": "暂存区中的当前内容连同提交信息储存为新提交。" 82 | }, 83 | "commit --amend": { 84 | "cmd": "commit --amend", 85 | "docs": "用当前暂存区的内容修改上一次的提交,也可以拿来修改提交信息。" 86 | }, 87 | "log": { 88 | "cmd": "log", 89 | "docs": "显示最近的提交,新的在上边。参数:\r`‑‑decorate` 显示分支和tag名字到对应的提交\r`‑‑stat` 显示状态 (文件修改, 添加, 删除) \r`‑‑author=` 只显示某个作者\r`‑‑after=\"MMM DD YYYY\"` 如(\"Jun 20 2008\") 只显示某个日期之后的提交\r`‑‑before=\"MMM DD YYYY\"` 只显示某个日期之前的提交\r`‑‑merge` 只与当前合并冲突有关的提交" 90 | }, 91 | "diff x x": { 92 | "cmd": "diff ", 93 | "docs": "显示两个提交之间的不同。" 94 | }, 95 | "branch": { 96 | "cmd": "branch", 97 | "docs": "显示所有(本地)存在的分支。参数 `-r` 显示远程追踪分支,参数 `-a` 显示全部。" 98 | }, 99 | "branch -d x": { 100 | "cmd": "branch -d ", 101 | "docs": "删除某个分支,使用 `—D` 来强制删除。" 102 | }, 103 | "branch --track x x": { 104 | "cmd": "branch --track ", 105 | "docs": "新建一个本地分支来跟踪一个远程分支。" 106 | }, 107 | "clone x": { 108 | "cmd": "clone ", 109 | "docs": "下载 `` 指定的仓库,并在工作区检出主分支的 `HEAD` 记录。" 110 | }, 111 | "pull x x": { 112 | "cmd": "pull ", 113 | "docs": "从远程仓库取得修改到当前分支. 一般来说, `git pull` 相当于 `git fetch` 然后再 `git merge FETCH_HEAD` 。" 114 | }, 115 | "reset --hard x/x": { 116 | "cmd": "reset --hard /", 117 | "docs": "重置本地仓库和工作区,让它与远程仓库一致。用 `reset ‑‑hard origin/main` 来丢弃所有的本地修改,通常会使用这个命令来处理失败的合并,记录会直接从远程仓库开始。" 118 | }, 119 | "fetch x x": { 120 | "cmd": "fetch ", 121 | "docs": "从远程仓库下载对象和引用(即版本信息)。" 122 | }, 123 | "push": { 124 | "cmd": "push", 125 | "docs": "从本地提交推送分支改变到远程,分支为所有推送过的分支。" 126 | }, 127 | "push x x": { 128 | "cmd": "push ", 129 | "docs": "向远程仓库推送新(或已存在的)的分支。" 130 | }, 131 | "push x x:x": { 132 | "cmd": "push :", 133 | "docs": "以另外一个名字推送分支到远程仓库。 是本地分支名称, 是远程仓库中的分支名称。" 134 | }, 135 | "branch -r": { 136 | "cmd": "branch -r", 137 | "docs": "列出远程分支。" 138 | }, 139 | "push --delete": { 140 | "cmd": "push --delete ", 141 | "docs": "删除一个远程分支。" 142 | }, 143 | "clean": { 144 | "cmd": "clean", 145 | "docs": "从当前文件夹开始递归清理不受版本管理的内容。使用 `-n` 显示将被删除的文件。使用 `-f` 删除文件。" 146 | }, 147 | "stash push": { 148 | "cmd": "stash push []", 149 | "docs": "保存当前修改到新的贮藏区,并且执行 `git reset --hard` 回滚. 是可选项,用来描述贮藏状态。想快速创建一个快照,省略掉 `push` 和 。" 150 | }, 151 | "stash apply": { 152 | "cmd": "stash apply []", 153 | "docs": "从指定贮藏中将修改应用到工作区,默认是最新的贮藏。" 154 | }, 155 | "stash pop": { 156 | "cmd": "stash pop", 157 | "docs": "应用最新(或指定的)贮藏中的修改,然后删除贮藏。" 158 | }, 159 | "stash list": { 160 | "cmd": "stash list", 161 | "docs": "显示当前你有的所有贮藏。" 162 | }, 163 | "stash show": { 164 | "cmd": "stash show []", 165 | "docs": "显示贮藏中记录的修改,对比贮藏生成时的原来状态。不指定 则显示最新的贮藏。" 166 | }, 167 | "stash drop": { 168 | "cmd": "stash drop []", 169 | "docs": "从贮藏区中删除单个贮藏;不指定 则删除最新的贮藏。" 170 | }, 171 | "stash clear": { 172 | "cmd": "stash clear", 173 | "docs": "清空贮藏区。注意相关存档会被清理,此操作`不能被恢复`。" 174 | }, 175 | "stash branch x": { 176 | "cmd": "stash branch []", 177 | "docs": "新建并检出一个新分支 , 分支开始于最初创建 的提交,应用贮藏的修改作为新的工作区和索引。\r如果命令执行成功,并且 是以 stash@{} 方式给出的,则删除这个 。未给出则使用最新的贮藏。\r如果运行 `git stash push` 的分支已更改到足以导致 `git stash apply` 因冲突而失败,那么这将非常有用。由于贮藏是在运行 `git stash` 时在 `HEAD` 的提交之上应用的,因此它可以恢复最初贮藏的状态,而不会发生冲突。" 178 | } 179 | }, 180 | "locations": { 181 | "stash": "贮藏区", 182 | "workspace": "工作区", 183 | "index": "暂存区", 184 | "local_repo": "本地仓库", 185 | "remote_repo": "上游仓库", 186 | "docs": { 187 | "stash": "当你去修改别的东西的时候,隐藏(临时保存)当前的修改的地方", 188 | "workspace": "你本地检出的代码。也被叫做 `工作拷贝`、`工作树` 或 `检出`。它是你文件系统上的任何一个目录,它有一个与之相关的仓库(通常通过其中存在一个名为 `.git` 的子目录来表示)。工作区包括该目录中的所有文件和子目录。", 189 | "index": "用于提交文件修改的暂存区域。在你“提交”(或记录)文件前,你首先需要将它们添加到索引中。也叫做 “当前目录缓存”、“暂存区”、“缓存”或“暂存文件”。", 190 | "local_repo": "`.git` 文件夹保存仓库需要的全部信息——即 Git 仓库的骨架,典型的分支: `main`, `master`, `feature-x`, `bugfix-y`。本地仓库具有与任何其他 Git 仓库完全相同的特性和功能。", 191 | "remote_repo": "与其他开发人员共享和协作的代码仓库。托管于某些网络或远端,例如 Github。默认名称是 \"origin\"。典型的分支:`main`、`master`、`shared-feature-x`、`release-y`。也被叫做“远程仓库”或“远端”。" 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/zh-tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": { 3 | "status": { 4 | "cmd": "status", 5 | "docs": "顯示狀態變化,包括了以下文件的路徑:\r• 暫存區與當前 `HEAD` 提交之間的差異(即將提交)\r• 工作區與暫存區之間的差異(下次不會提交)\r• 沒有被 Git 所追蹤(沒有歷史記錄)" 6 | }, 7 | "diff": { 8 | "cmd": "diff", 9 | "docs": "顯示工作區中尚未添加到暫存區中檔案的不同,亦即對比執行 `git add` 命令之前的檔案" 10 | }, 11 | "diff x": { 12 | "cmd": "diff ", 13 | "docs": "查看工作區與某一次提交(commit)之間的不同,你也可以指定 `HEAD` 來對比上一次的提交,或者是使用分支(branch)名稱來和分支進行比較" 14 | }, 15 | "add x": { 16 | "cmd": "add ", 17 | "docs": "添加當前的更新內容或是修改的文件到暫存區,作為下次提交的部分內容。可以使用 `add --interactive` 進行互動式操作" 18 | }, 19 | "add -u": { 20 | "cmd": "add -u", 21 | "docs": "添加當前修改(但不包含新的文件)到暫存區, 這與 `git commit -a` 準備提交內容的方式一致" 22 | }, 23 | "rm x": { 24 | "cmd": "rm ", 25 | "docs": "從工作區和暫存區刪除檔案" 26 | }, 27 | "mv x": { 28 | "cmd": "mv ", 29 | "docs": "從工作區和暫存區移動檔案" 30 | }, 31 | "commit -a": { 32 | "cmd": "commit -a [-m 'msg']", 33 | "docs": "提交上次提交之後的所有修改,但未被追蹤的文件(亦即所有暫存區中有記錄的文件)除外,並且會從暫存區刪除已在工作區刪除的文件" 34 | }, 35 | "checkout x": { 36 | "cmd": "checkout ", 37 | "docs": "更新工作區文件或目錄,這並不會切換分支(branch)" 38 | }, 39 | "reset head x": { 40 | "cmd": "reset HEAD ", 41 | "docs": "刪除下一次提交中的指定文件,這會重置索引區記錄但是不會影響到工作樹(也就是說,改動的文件會被保留,但不會被提交),並列出沒有被更新的文件" 42 | }, 43 | "reset --soft head^": { 44 | "cmd": "reset --soft HEAD^", 45 | "docs": "恢復上一次提交,保留暫存區的改動" 46 | }, 47 | "reset --hard": { 48 | "cmd": "reset --hard", 49 | "docs": "恢復工作區和暫存區到上次提交的狀態。[警告] 所有工作區中所做的修改都會被丟棄,因此可以使用這條指令來解決合併衝突,會將狀態從新開始。傳入 `ORIG_HEAD` 可以用來撤銷該次提交以來的所有改動" 50 | }, 51 | "switch": { 52 | "cmd": "switch ", 53 | "docs": "切換分支,更改工作區和暫存區為 `` 分支的內容,之後 `HEAD` 會指向 `` 分支" 54 | }, 55 | "checkout -b x": { 56 | "cmd": "checkout -b ", 57 | "docs": "創建一個分支並且立即切換過去" 58 | }, 59 | "merge x": { 60 | "cmd": "merge ", 61 | "docs": "從 `` 分支合併到當前分支。使用 `--no-commit` 可以在合併後保持為尚未提交的狀態;使用 `--no-ff` 可以創建一個合併的提交狀態,即使合併的分支內容是自己的直接後代(fast-forward)" 62 | }, 63 | "rebase x": { 64 | "cmd": "rebase ", 65 | "docs": "回滾當前分支與 `` 分開處的所有提交紀錄,將這些提交紀錄一一應用到 `` 分支的 `HEAD` 作為新的提交紀錄" 66 | }, 67 | "cherry-pick x": { 68 | "cmd": "cherry-pick ", 69 | "docs": "把某個提交移動到當前分支來" 70 | }, 71 | "revert x": { 72 | "cmd": "revert ", 73 | "docs": "回滾 `` 指定的提交,這需要當前工作區是乾凈的,即相比於 `HEAD` 提交沒有修改" 74 | }, 75 | "diff --cached": { 76 | "cmd": "diff --cached []", 77 | "docs": "查看已經暫存的內容和上次提交的區別,也可指定某一提交" 78 | }, 79 | "commit": { 80 | "cmd": "commit [-m 'msg']", 81 | "docs": "暫存區中的當前內容連同提交信息儲存為新提交" 82 | }, 83 | "commit --amend": { 84 | "cmd": "commit --amend", 85 | "docs": "用當前暫存區的內容修改最近一次的提交,也可以拿來修改提交訊息(commit messages)" 86 | }, 87 | "log": { 88 | "cmd": "log", 89 | "docs": "顯示最近的提交紀錄,最新的紀錄會在上方。參數可以為:\r`--decorate` 顯示分支(branch)和標籤(tag)名稱到對應的提交紀錄\r`--stat` 顯示狀態(文件修改、添加或刪除)\r`--author=` 只顯示特定作者的提交紀錄\r`--after=\"MMM DD YYYY\"` 只顯示特定時間之後的提交紀錄,時間格式如 `\"Jun 20 2008\"`\r`--before=\"MMM DD YYYY\"` 只顯示特定時間之前的提交紀錄\r`--merge` 只顯示與當前合併衝突有關的提交紀錄" 90 | }, 91 | "diff x x": { 92 | "cmd": "diff ", 93 | "docs": "顯示兩個提交之間的不同" 94 | }, 95 | "branch": { 96 | "cmd": "branch", 97 | "docs": "顯示所有(本地)存在的分支。參數 `-r` 顯示遠端追蹤分支,參數 `-a` 顯示全部" 98 | }, 99 | "branch -d x": { 100 | "cmd": "branch -d ", 101 | "docs": "刪除某個分支,使用 `—D` 來強制刪除" 102 | }, 103 | "branch --track x x": { 104 | "cmd": "branch --track ", 105 | "docs": "添加一個本地分支來跟蹤某個遠端分支" 106 | }, 107 | "clone x": { 108 | "cmd": "clone ", 109 | "docs": "下載 `` 指定的版本倉庫,並在工作區中檢出主要分支(通常為 `main` 或 `main` 分支)的 `HEAD` 紀錄" 110 | }, 111 | "pull x x": { 112 | "cmd": "pull ", 113 | "docs": "從遠端版本倉庫取得修改到當前分支。一般來說, `git pull` 相當於 `git fetch` 然後做 `git merge FETCH_HEAD`" 114 | }, 115 | "reset --hard x/x": { 116 | "cmd": "reset --hard /", 117 | "docs": "重置本地版本倉庫,讓它與遠端版本一致;可以使用 `reset --hard origin/main` 來丟棄所有的本地改動,通常會使用這個指令來處理失敗的合併,紀錄會直接從遠端倉庫開始" 118 | }, 119 | "fetch x x": { 120 | "cmd": "fetch ", 121 | "docs": "從遠端版本倉庫下載對象和引用(亦即版本資訊)" 122 | }, 123 | "push": { 124 | "cmd": "push", 125 | "docs": "從本地提交推送分支改變到遠端,分支為所有推送過的分支" 126 | }, 127 | "push x x": { 128 | "cmd": "push ", 129 | "docs": "向遠端版本倉庫推送新的(已存在的)分支" 130 | }, 131 | "push x x:x": { 132 | "cmd": "push :", 133 | "docs": "向遠端版本倉庫推送分支,但是從不同的(本地)分支名稱推送" 134 | }, 135 | "branch -r": { 136 | "cmd": "branch -r", 137 | "docs": "顯示遠端倉庫分支" 138 | }, 139 | "push --delete": { 140 | "cmd": "push --delete ", 141 | "docs": "刪除一個遠端分支,通過向遠端分支推送空內容" 142 | }, 143 | "clean": { 144 | "cmd": "clean", 145 | "docs": "從當前目錄遞迴地清除沒有進行版本控制的內容" 146 | }, 147 | "stash push": { 148 | "cmd": "stash push []", 149 | "docs": "將當前本地的修改保存到新的存檔中,並且執行 `git reset --hard` 回滾。其中 `` 是可選項,用來描述存檔的說明,如果想要快速創建存檔,可以同時省略掉 `push` 和 ``" 150 | }, 151 | "stash apply": { 152 | "cmd": "stash apply []", 153 | "docs": "將指定存檔 `` 中的變動應用到工作區中,預設狀態是最近的存檔" 154 | }, 155 | "stash pop": { 156 | "cmd": "stash pop", 157 | "docs": "應用上一次(或指定)的存檔變動,並將其從儲藏區中移除" 158 | }, 159 | "stash list": { 160 | "cmd": "stash list", 161 | "docs": "顯示目前所有的儲存狀態紀錄" 162 | }, 163 | "stash show": { 164 | "cmd": "stash show []", 165 | "docs": "顯示儲藏區中存檔的改動,對比存檔生成時的原始狀態,如果沒有指定 `` 則會顯示上一次添加存檔的變動情形" 166 | }, 167 | "stash drop": { 168 | "cmd": "stash drop []", 169 | "docs": "從儲藏區中刪除單個狀態,如果沒有指定 `` 則會刪除上一次添加的存檔" 170 | }, 171 | "stash clear": { 172 | "cmd": "stash clear", 173 | "docs": "清除儲藏區中的所有存檔。注意這個指令會清除相關存檔,並且此操作不能恢復" 174 | }, 175 | "stash branch x": { 176 | "cmd": "stash branch []", 177 | "docs": "新建並檢出一個新的分支 ``,這個分支會以 `` 存檔建立時的來源進行提交,並將 `` 中所記錄的狀態應用到新的工作樹與索引上。如果指令執行成功,並且 `` 是參照到 `stash@{}` 存檔,則會將該存檔從暫存區中刪除。如果沒有指定 ``,則會使用最後一個存檔。這個指令在當前分支運行 `git stash push` 導致衝突時十分好用,因為存檔會被應用在 `git stash` 被執行時的 `HEAD` 上,並還原原始存檔狀態所以不會導致衝突" 178 | } 179 | }, 180 | "locations": { 181 | "stash": "儲藏區(Stash)", 182 | "workspace": "工作區(Workspace)", 183 | "index": "暫存區(Index)", 184 | "local_repo": "本地倉庫(Local Repository)", 185 | "remote_repo": "遠端倉庫(Upstream Repository)", 186 | "docs": { 187 | "stash": "當你去修改其他東西時,用來隱藏(臨時保存)當前修改內容的地方", 188 | "workspace": "本地專案中存放原始檔案的資料夾,即本地檢出(Local checkout)", 189 | "index": "保存你所要提交(commit)的檔案。在提交檔案之前,你必須先將這些檔案添加到 Index 中,因此又稱為「當前目錄快取(current directory cache)」、「暫存區域(staging area)」、「快取(cache)」或「暫存檔案(staged files)」", 190 | "local_repo": "有一個名稱為 `.git` 的子目錄,用以保存版本倉庫所需要的全部資訊 —— 亦即 Git 倉庫的骨架。一般典型的分支(branch)會有:`main`, `feature-x`, `bugfix-y` 等", 191 | "remote_repo": "存放於區域網路或網際網路上,供其他開發者使用的版本倉庫,預設名稱為 `origin`。一般典型的分支(branch)會有:`main`, `feature-x`, `bugfix-y` 等" 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": { 3 | "status": { 4 | "cmd": "status", 5 | "docs": "표시: \r• 인덱스 파일과 현재 `HEAD` 커밋 사이에 차이가 있는 경로, \r• 작업 공간과 인덱스 카일간 차이가 나는 경로, \r• git에서 추적하지 않는 작업 영역에서의 경로." 6 | }, 7 | "diff": { 8 | "cmd": "diff", 9 | "docs": "인덱스에 추가되지 않은 차이점을 보여줍니다." 10 | }, 11 | "diff x": { 12 | "cmd": "diff ", 13 | "docs": "이름이 정해진 과 관련된 workplace의 변경 사항을 확인합니다. `HEAD`를 사용하여 최신 커밋과 비교하거나 branch 이름을 이용하여 다른 branch를 비교할 수 있습니다." 14 | }, 15 | "add x": { 16 | "cmd": "add ", 17 | "docs": "새로운 파일 또는 수정된 파일에 대한 현재 내용을 인덱스에 추가하여 다음 커밋에 포함할 내용을 준비합니다. `add --interactive`를 이용하여 수정된 내용을 대화식으로 workplace에서 인덱스로 추가할 수 있습니다." 18 | }, 19 | "add -u": { 20 | "cmd": "add -u", 21 | "docs": "수정된 (새롭게 만든게 아닌) 파일의 현재 내용을 인덱스에 추가합니다. 이는 `git commit -a`로 커밋을 준비하는 것과 비슷합니다." 22 | }, 23 | "rm x": { 24 | "cmd": "rm ", 25 | "docs": "Workspace와 인덱스에서 파일을 삭제합니다." 26 | }, 27 | "mv x": { 28 | "cmd": "mv ", 29 | "docs": "Workspace와 인덱스에서 파일을 옮깁니다." 30 | }, 31 | "commit -a": { 32 | "cmd": "commit -a [-m 'msg']", 33 | "docs": "추적하지 않는 파일을 제외하고, 마지막 커밋 이후 인덱스에 나열된 모든 파일을 커밋합니다. 인덱스에서 삭제된 파일은 workspace에서 삭제됩니다." 34 | }, 35 | "checkout x": { 36 | "cmd": "checkout ", 37 | "docs": "Workspace에 있는 파일과 디렉토리를 업데이트 합니다. 브런치를 바꾸지 말아야합니다." 38 | }, 39 | "reset head x": { 40 | "cmd": "reset HEAD ", 41 | "docs": "다음 커밋에서 지정된 파일을 제거합니다. 인덱스를 재설정하지만, 작업 트리는 다시 설정 하지 않습니다. 변경된 파일은 보존되지만 커밋으로 표시되지 않습니다. 그리고 업데이트 하지 않은 내용을 보여줍니다." 42 | }, 43 | "reset --soft head^": { 44 | "cmd": "reset --soft HEAD^", 45 | "docs": "마지막 커밋을 실행 취소하고, 인덱스에서 변경 내용을 남겨둡니다." 46 | }, 47 | "reset --hard": { 48 | "cmd": "reset --hard", 49 | "docs": "Workplace와 인덱스를 로컬 트리와 일치시킵니다. 경고: 커밋 이후 작업 중인 트리에서 추적 중인 파일에 대한 변경 사항이 사라집니다. 병합으로 인해 충돌이 발생하여 처음부터 다시 시작하려는 경우에 사용합니다. `ORGI_HEAD`로 수정하게되면 가장 최근에 성공한 병합과 이후 변경 사항을 취소할 수 있습니다." 50 | }, 51 | "switch": { 52 | "cmd": "switch ", 53 | "docs": "지정한 branch인 를 인덱스와 workspace를 반영하고, `HEAD`를 로 업데이트하여 branch를 변경합니다." 54 | }, 55 | "checkout -b x": { 56 | "cmd": "checkout -b ", 57 | "docs": "Branch를 만들고 변경합니다." 58 | }, 59 | "merge x": { 60 | "cmd": "merge ", 61 | "docs": "에서 변경한 내용을 현재 branch로 병합합니다.\r`‑‑no-commit`을 사용하여 커밋되지 않은 변경 내용을 남겨둘 수 있습니다. 만약 병합을 빠른 감기(fast forward)로 진행되더라도 `--no-ff` 를 사용하여 병합 커밋을 만듭니다." 62 | }, 63 | "rebase x": { 64 | "cmd": "rebase ", 65 | "docs": "현재 branch가 에서 분기된 이후 모든 커밋을 되돌리고, `HEAD`에서 변경 내용을 하나씩 다시 적용합니다." 66 | }, 67 | "cherry-pick x": { 68 | "cmd": "cherry-pick ", 69 | "docs": "선택한 커밋의 변경 내용을 현재 branch에 통합합니다." 70 | }, 71 | "revert x": { 72 | "cmd": "revert ", 73 | "docs": "선택한 을 역방향 커밋을 실행하고 그 결과를 커밋합니다. 이렇게하려면 작업 트리를 정리해야합니다 (`HEAD` 커밋을 수정할 필요는 없습니다)." 74 | }, 75 | "diff --cached": { 76 | "cmd": "diff --cached []", 77 | "docs": "작업 중인 변경 내용과 최신 커밋을 비교합니다. 을 추가하면 해당 커밋에서의 변경 내용을 확인할 수 있습니다." 78 | }, 79 | "commit": { 80 | "cmd": "commit [-m 'msg']", 81 | "docs": "변경 내용을 설명하는 메시지와 인덱스에 있는 내용을 새로운 커밋에 저장합니다." 82 | }, 83 | "commit --amend": { 84 | "cmd": "commit --amend", 85 | "docs": "현재 인덱스 변경으로 마지막 커밋을 수정합니다." 86 | }, 87 | "log": { 88 | "cmd": "log", 89 | "docs": "최근 커밋을 보여줍니다. 가장 최근 커밋이 맨위에 있습니다. 옵션:\r`‑‑decorate` 커밋에 있는 branch와 태그 이름으로 보여줍니다.\r`‑‑stat` 로그 통계를 냅니다. (파일 변경, 추가, 삭제)\r`‑‑author=` 특정 사용자가 커밋한 내용으로 보여줍니다.\r`‑‑after=\"MMM DD YYYY\"` 예(`Jun 20 2008`) 특정 날짜 이전에 커밋된 커밋을 보여줍니다.\r`‑‑before=\"MMM DD YYYY\"` 특정 날짜 이후에 커밋된 커밋을 보여줍니다.\r`‑‑merge` 현재 병합 충돌에 관련된 커밋만 보여줍니다." 90 | }, 91 | "diff x x": { 92 | "cmd": "diff ", 93 | "docs": "임의의 두 커밋간의 변경 내용을 확인합니다." 94 | }, 95 | "branch": { 96 | "cmd": "branch", 97 | "docs": "모든 branch를 보여줍니다. `-r` 옵션은 원격 branch를 보여주고, `-a`는 원격, 로컬에 있는 branch를 보여줍니다." 98 | }, 99 | "branch -d x": { 100 | "cmd": "branch -d ", 101 | "docs": "특정 branch를 삭제합니다. `-D`를 이용하여 강제로 삭제할 수 있습니다." 102 | }, 103 | "branch --track x x": { 104 | "cmd": "branch --track ", 105 | "docs": "원격 branch를 따르는 새 로컬 branch를 만듭니다." 106 | }, 107 | "clone x": { 108 | "cmd": "clone ", 109 | "docs": "로 지정된 저장소를 다운로드하고 main 브런치의 `HEAD`를 체크아웃 합니다." 110 | }, 111 | "pull x x": { 112 | "cmd": "pull ", 113 | "docs": "원격 저장소의 변경 내용을 현재 branch에 반영합니다. 기본 모드에서 `git pull` 명령은 `git fetch`와 `git merge FETCH_HEAD`를 줄인 명령어입니다." 114 | }, 115 | "reset --hard x/x": { 116 | "cmd": "reset --hard /", 117 | "docs": "로컬 저장소와 작업 트리를 리셋하여 원격 branch와 일치시킵니다. `reset ‑‑hard origin/main`를 사용하여 로컬 마스터 branch에서 모든 커밋을 버립니다. 이를 사용하여 실패한 병합을 다시 시작합니다." 118 | }, 119 | "fetch x x": { 120 | "cmd": "fetch ", 121 | "docs": "다른 저장소에서 object와 refs를 다운받습니다." 122 | }, 123 | "push": { 124 | "cmd": "push", 125 | "docs": "로컬 저장소와 원격 저장소 사이의 *공통적인* 모든 지점에서 커밋을 사용하여 원격 저장소로 업데이트합니다. 처음부터 원격 저장소에 업데이트되지 않은 로컬 branch는 공유되지 않습니다." 126 | }, 127 | "push x x": { 128 | "cmd": "push ", 129 | "docs": "새로운 저장소 (또는 기존 저장소)를 원격 저장소로 업로드합니다." 130 | }, 131 | "push x x:x": { 132 | "cmd": "push :", 133 | "docs": "다른 이름으로 새로운 저장소를 원격 저장소로 업로드합니다." 134 | }, 135 | "branch -r": { 136 | "cmd": "branch -r", 137 | "docs": "원격 branch를 보여줍니다." 138 | }, 139 | "push --delete": { 140 | "cmd": "push --delete ", 141 | "docs": "원격 브런치를 삭제합니다. 글자 그대로 \"이 지점에 아무것도 보내지마라.\" 입니다." 142 | }, 143 | "clean": { 144 | "cmd": "clean", 145 | "docs": "현재 디렉토리에서 시작하여 버전 제어하고 있지 않은 파일을 재귀적으로 제거하여 작업 트리를 정리합니다. `-n`을 사용하여 \"dry run\" 형식으로 삭제될 내용을 확인할 수 있습니다. `-f`는 파일을 삭제합니다." 146 | }, 147 | "stash push": { 148 | "cmd": "stash push []", 149 | "docs": "로컬 변경 내용을 새로운 stash 저장하고, `git reset ‑‑hard`를 실행하여 되돌립니다. 항목은 선택 사항이며, 숨기는 상태와 그에 대한 설명을 입력할 수 있습니다. 스냅 샷을 빠르게 작성하려면 `push`와 를 생략할 수 있습니다." 150 | }, 151 | "stash apply": { 152 | "cmd": "stash apply []", 153 | "docs": "변경 내역을 stash 영역에서 workspace 영역으로 이동합니다. 최근에 저장한 stash 값이 기본 값입니다." 154 | }, 155 | "stash pop": { 156 | "cmd": "stash pop", 157 | "docs": "마지막이나 지정된 stash 변경 내용을 적용한뒤 stash에서 해당 내용을 삭제합니다." 158 | }, 159 | "stash list": { 160 | "cmd": "stash list", 161 | "docs": "현재 가지고 있는 stash 항목을 보여줍니다." 162 | }, 163 | "stash show": { 164 | "cmd": "stash show []", 165 | "docs": "Stash에 기록된 변경 내용을 stash 상태와 원래 부모 커밋 사이의 차이점을 보여줍니다. 가 명시되지 않은 경우, 가장 최근의 stash 항목에대한 내용을 보여줍니다." 166 | }, 167 | "stash drop": { 168 | "cmd": "stash drop []", 169 | "docs": "Stash 항목에서 하나의 stash 항목을 삭제합니다. 가 명시되지 않은 경우, 가장 최근의 stash 항목을 삭제합니다." 170 | }, 171 | "stash clear": { 172 | "cmd": "stash clear", 173 | "docs": "Stash 항목을 모두 삭제합니다. 이럴경우, 가지 치기의 대상이되며, 복구가 불가능합니다." 174 | }, 175 | "stash branch x": { 176 | "cmd": "stash branch []", 177 | "docs": "를 기존 작성된 커밋에서 시작하여 으로 brach를 생성하고 체크 아웃합니다. 에 기록된 변경 내용은 새 작업 트리와 색인에 적용됩니다. \r성공하면 는 stash@{} 형식의 참조하고 를 삭제합니다. 가 주어지지 않으면, 최근 저장된 stash 항목을 사용합니다. \r이것은 `git stash push`를 실행한 브런치가 변경되어 `git stash apply`시 충돌이 날때 유용합니다. stash는 `git stash`가 실행될 때, `HEAD`였던 커밋의 맨 위에 적용되기 때문에 충돌없이 기존 stash 상태로 복원합니다." 178 | } 179 | }, 180 | "locations": { 181 | "stash": "stash", 182 | "workspace": "workspace", 183 | "index": "index", 184 | "local_repo": "local repository", 185 | "remote_repo": "upstream repository", 186 | "docs": { 187 | "stash": "다른 작업을하는 동안 수정 사항을 숨겨둘 수 있는 장소", 188 | "workspace": "로컬 체크 아웃", 189 | "index": "커밋하기를 원하는 파일. 파일을 \"commit\"(checkin) 하기 전에 먼저 Index에 추가하여야 합니다. \"현재 디렉토리 캐시\", \"스테이징 영역\", \"캐시\", 스태이지 파일\" 으로 불리웁니다.", 190 | "local_repo": "필요한 저장소 파일들을 모두 포함하고 있는 `.git`이라는 서브 디렉토리 (Git 저장소 뼈대를 말한다). 일반적인 브런치: `main`, `feature-x`, `bugfix-y`", 191 | "remote_repo": "인터넷이나 네트워크로 호스팅되는 프로젝트 버전으로, 모든 변경 사항을 다른 개발자들과 공유하여 사용할 수 있습니다. 기본 이름은 `origin`. 일반적인 브런치: `main`, `shared-feature-x`, `release-y`" 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /src/commands.mjs: -------------------------------------------------------------------------------- 1 | export const locations = ["stash", "workspace", "index", "local_repo", "remote_repo"] 2 | 3 | export const commands = [ 4 | { 5 | "left": "workspace", 6 | "right": "index", 7 | "direction": "status", 8 | "key": "status", 9 | "tags": "Basic Snapshotting", 10 | }, 11 | { 12 | "left": "workspace", 13 | "right": "index", 14 | "direction": "status", 15 | "key": "diff", 16 | "tags": "Basic Snapshotting,Inspection and Comparison,Patching", 17 | }, 18 | { 19 | "left": "workspace", 20 | "right": "local_repo", 21 | "direction": "status", 22 | "key": "diff x", 23 | "tags": "Basic Snapshotting,Inspection and Comparison,Patching", 24 | }, 25 | { 26 | "left": "workspace", 27 | "right": "index", 28 | "direction": "up", 29 | "key": "add x", 30 | "tags": "Basic Snapshotting", 31 | }, 32 | { 33 | "left": "workspace", 34 | "right": "index", 35 | "direction": "up", 36 | "key": "add -u", 37 | "tags": "Basic Snapshotting", 38 | }, 39 | { 40 | "left": "workspace", 41 | "right": "index", 42 | "direction": "up", 43 | "key": "rm x", 44 | "tags": "Basic Snapshotting", 45 | }, 46 | { 47 | "left": "workspace", 48 | "right": "index", 49 | "direction": "up", 50 | "key": "mv x", 51 | "tags": "Basic Snapshotting", 52 | }, 53 | { 54 | "left": "workspace", 55 | "right": "local_repo", 56 | "direction": "up", 57 | "key": "commit -a", 58 | "tags": "Basic Snapshotting", 59 | }, 60 | { 61 | "left": "workspace", 62 | "right": "index", 63 | "direction": "dn", 64 | "key": "checkout x", 65 | "tags": "Branching and Merging", 66 | }, 67 | { 68 | "left": "index", 69 | "right": "index", 70 | "direction": "status", 71 | "key": "reset head x", 72 | "tags": "Basic Snapshotting", 73 | }, 74 | { 75 | "left": "local_repo", 76 | "right": "local_repo", 77 | "direction": "status", 78 | "key": "reset --soft head^", 79 | "tags": "Basic Snapshotting", 80 | }, 81 | { 82 | "left": "workspace", 83 | "right": "local_repo", 84 | "direction": "dn", 85 | "key": "reset --hard", 86 | "tags": "Basic Snapshotting", 87 | }, 88 | { 89 | "left": "workspace", 90 | "right": "local_repo", 91 | "direction": "dn", 92 | "key": "reset --hard x/x", 93 | "tags": "Basic Snapshotting", 94 | }, 95 | { 96 | "left": "workspace", 97 | "right": "local_repo", 98 | "direction": "dn", 99 | "key": "switch", 100 | "tags": "Branching and Merging", 101 | }, 102 | { 103 | "left": "workspace", 104 | "right": "local_repo", 105 | "direction": "dn", 106 | "key": "checkout -b x", 107 | "tags": "Branching and Merging", 108 | }, 109 | { 110 | "left": "workspace", 111 | "right": "local_repo", 112 | "direction": "dn", 113 | "key": "merge x", 114 | "tags": "Branching and Merging", 115 | }, 116 | { 117 | "left": "workspace", 118 | "right": "local_repo", 119 | "direction": "dn", 120 | "key": "rebase x", 121 | "tags": "Patching", 122 | }, 123 | { 124 | "left": "workspace", 125 | "right": "local_repo", 126 | "direction": "dn", 127 | "key": "cherry-pick x", 128 | "tags": "Patching", 129 | }, 130 | { 131 | "left": "workspace", 132 | "right": "local_repo", 133 | "direction": "dn", 134 | "key": "revert x", 135 | }, 136 | { 137 | "left": "index", 138 | "right": "local_repo", 139 | "direction": "status", 140 | "key": "diff --cached", 141 | "tags": "Basic Snapshotting,Inspection and Comparison,Patching", 142 | }, 143 | { 144 | "left": "index", 145 | "right": "local_repo", 146 | "direction": "up", 147 | "key": "commit", 148 | "tags": "Basic Snapshotting", 149 | }, 150 | { 151 | "left": "index", 152 | "right": "local_repo", 153 | "direction": "up", 154 | "key": "commit --amend", 155 | "tags": "Basic Snapshotting", 156 | }, 157 | { 158 | "left": "local_repo", 159 | "right": "local_repo", 160 | "direction": "status", 161 | "key": "log", 162 | "tags": "Branching and Merging, Inspection and Comparison", 163 | }, 164 | { 165 | "left": "local_repo", 166 | "right": "local_repo", 167 | "direction": "status", 168 | "key": "diff x x", 169 | "tags": "Basic Snapshotting, Inspection and Comparison,Patching", 170 | }, 171 | { 172 | "left": "local_repo", 173 | "right": "local_repo", 174 | "direction": "status", 175 | "key": "branch", 176 | "tags": "Branching and Merging", 177 | }, 178 | {"left": "remote_repo", 179 | "right": "remote_repo", 180 | "direction": "status", 181 | "key": "branch -r", 182 | "tags": "Branching and Merging"}, 183 | { 184 | "left": "local_repo", 185 | "right": "local_repo", 186 | "direction": "status", 187 | "key": "branch -d x", 188 | "tags": "Branching and Merging", 189 | }, 190 | { 191 | "left": "local_repo", 192 | "right": "remote_repo", 193 | "direction": "dn", 194 | "key": "branch --track x x", 195 | "tags": "Branching and Merging", 196 | }, 197 | { 198 | "left": "workspace", 199 | "right": "remote_repo", 200 | "direction": "dn", 201 | "key": "clone x", 202 | "tags": "Creating Projects", 203 | }, 204 | { 205 | "left": "workspace", 206 | "right": "remote_repo", 207 | "direction": "dn", 208 | "key": "pull x x", 209 | "tags": "Sharing and Updating", 210 | }, 211 | { 212 | "left": "local_repo", 213 | "right": "remote_repo", 214 | "direction": "dn", 215 | "key": "fetch x x", 216 | "tags": "Sharing and Updating", 217 | }, 218 | { 219 | "left": "local_repo", 220 | "right": "remote_repo", 221 | "direction": "up", 222 | "key": "push", 223 | "tags": "Sharing and Updating", 224 | }, 225 | { 226 | "left": "local_repo", 227 | "right": "remote_repo", 228 | "direction": "up", 229 | "key": "push x x", 230 | "tags": "Sharing and Updating", 231 | }, 232 | { 233 | "left": "local_repo", 234 | "right": "remote_repo", 235 | "direction": "up", 236 | "key": "push x x:x", 237 | "tags": "Sharing and Updating", 238 | }, 239 | { 240 | "left": "remote_repo", 241 | "right": "remote_repo", 242 | "direction": "status", 243 | "key": "push --delete", 244 | "tags": "Sharing and Updating", 245 | }, 246 | { 247 | "left": "workspace", 248 | "right": "workspace", 249 | "direction": "dn", 250 | "key": "clean", 251 | "tags": "Administration", 252 | }, 253 | { 254 | "left": "stash", 255 | "right": "workspace", 256 | "direction": "dn", 257 | "key": "stash push", 258 | "tags": "Branching and Merging", 259 | }, 260 | { 261 | "left": "stash", 262 | "right": "workspace", 263 | "direction": "up", 264 | "key": "stash pop", 265 | "tags": "Branching and Merging", 266 | }, 267 | { 268 | "left": "stash", 269 | "right": "workspace", 270 | "direction": "up", 271 | "key": "stash apply", 272 | "tags": "Branching and Merging", 273 | }, 274 | { 275 | "left": "stash", 276 | "right": "stash", 277 | "direction": "status", 278 | "key": "stash list", 279 | "tags": "Branching and Merging", 280 | }, 281 | { 282 | "left": "stash", 283 | "right": "stash", 284 | "direction": "status", 285 | "key": "stash show", 286 | "tags": "Branching and Merging", 287 | }, 288 | { 289 | "left": "stash", 290 | "right": "stash", 291 | "direction": "status", 292 | "key": "stash drop", 293 | "tags": "Branching and Merging", 294 | }, 295 | { 296 | "left": "stash", 297 | "right": "stash", 298 | "direction": "status", 299 | "key": "stash clear", 300 | "tags": "Branching and Merging", 301 | }, 302 | { 303 | "left": "stash", 304 | "right": "local_repo", 305 | "direction": "up", 306 | "key": "stash branch x", 307 | "tags": "Branching and Merging", 308 | }, 309 | ] 310 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "locations": { 3 | "stash": "stash", 4 | "workspace": "workspace", 5 | "index": "index", 6 | "local_repo": "repositorio local", 7 | "remote_repo": "repositorio remoto", 8 | "docs": { 9 | "stash": "Un lugar para ocultar cambios mientras trabajas en otra cosa", 10 | "workspace": "Espacio de trabajo: archivos locales posicionados en una rama", 11 | "index": "El index (o \"staging area\") contiene una captura del contenido del árbol de trabajo. Esta captura representa a los contenidos del próximo commit.", 12 | "local_repo": "Un subdirectorio llamado .git que contiene todos los archivos necesarios — un esqueleto del repositorio Git. Ramas típicas: `main`, `feature-x`, `bugfix-y`", 13 | "remote_repo": "Version(es) del proyecto que están alojadas en Internet o una red, asegurando que todos los cambios están disponibles para otros desarrolladores. Por defecto es \"origin\". Ramas típicas aquí son: `main`, `shared-feature-x`, `release-y`" 14 | } 15 | }, 16 | "commands": { 17 | "status": { 18 | "cmd": "status", 19 | "docs": "Muestra las localizaciones que tienen diferencias entre el index y el commit `HEAD` actual, localizaciones que tienen diferencias entre el workspace y el index, y localizaciones en el workspace que no están siendo registradas por git" 20 | }, 21 | "diff": { 22 | "cmd": "diff", 23 | "docs": "Muestra las diferencias no añadidas al index." 24 | }, 25 | "diff x": { 26 | "cmd": "diff ", 27 | "docs": "Muestra los cambios que existen en el workspace relativos al mencionado. Puede usarse `HEAD` para comparar contra el último commit, o el nombre de una rama (branch) para comparar contra otra rama" 28 | }, 29 | "add x": { 30 | "cmd": "add ", 31 | "docs": "Añade el contenido actual de archivos nuevos o modificados al index, preparando a la vez ese contenido para ser incluído en el próximo commit. Usar `add --interactive` para añadir los contenidos del espacio de trabajo al index de manera interactiva." 32 | }, 33 | "add -u": { 34 | "cmd": "add -u", 35 | "docs": "Añade el contenido actual de los archivos modificados (NO NUEVOS) al index. Es similar a lo que hace 'git commit -a' al prepararse para realizar un commit." 36 | }, 37 | "rm x": { 38 | "cmd": "rm ", 39 | "docs": "Elimina uno o varios archivos del espacio de trabajo e index." 40 | }, 41 | "mv x": { 42 | "cmd": "mv ", 43 | "docs": "Mueve uno o varios archivos del espacio de trabajo e index." 44 | }, 45 | "commit -a": { 46 | "cmd": "commit -a [-m 'msg']", 47 | "docs": "Realiza un commit con todos los cambios en los archivos desde el último commit, excluyendo los archivos no registrados (ej: todos los archivos que están listados en index). Elimina archivos en index que fueron eliminados del espacio de trabajo." 48 | }, 49 | "checkout x": { 50 | "cmd": "checkout ", 51 | "docs": "Actualiza el archivo o directorio en el espacio de trabajo. Esto NO cambia de rama." 52 | }, 53 | "reset head x": { 54 | "cmd": "reset HEAD ", 55 | "docs": "Descarta los archivos especificados del próximo commit. Restablece el index pero no el árbol de trabajo (ej:, los cambios en archivos se mantienen pero no se preparan para commit) y reporta cuales no han sido actualizados." 56 | }, 57 | "reset --soft head^": { 58 | "cmd": "reset --soft HEAD^", 59 | "docs": "Deshace el último commit, dejando los cambio en el index." 60 | }, 61 | "reset --hard": { 62 | "cmd": "reset --hard", 63 | "docs": "Equipara el espacio de trabajo y el index al árbol local. ADVERTENCIA: Se pierden todos los cambios a archivos registrados por git desde el último commit. Usar este comando si una combinación/merge resultó en conflictos y es necesario comenzar de nuevo. Al pasar `ORIG_HEAD` puede deshacerse el merge más reciente y todos los cambios posteriores." 64 | }, 65 | "switch": { 66 | "cmd": "switch ", 67 | "docs": "Cambia de rama actualizando el index y el espacio de trabajo para reflejar la rama especificada, , y actualizando la posición de `HEAD` a ." 68 | }, 69 | "checkout -b x": { 70 | "cmd": "checkout -b ", 71 | "docs": "Crea una rama y posiciona el `HEAD` allí" 72 | }, 73 | "merge x": { 74 | "cmd": "merge ", 75 | "docs": "Combina (merge) los cambios de con los de la rama actual.\rUsar `‑‑no-commit` para dejar los cambios sin realizar un commit." 76 | }, 77 | "rebase x": { 78 | "cmd": "rebase ", 79 | "docs": "Revierte todos los commits desde que la rama actual se separó del , y luego los vuelve a aplicar uno por uno por sobre los commits del `HEAD` de ." 80 | }, 81 | "cherry-pick x": { 82 | "cmd": "cherry-pick ", 83 | "docs": "Aplica los cambios del commit especificado en la rama actual." 84 | }, 85 | "revert x": { 86 | "cmd": "revert ", 87 | "docs": "Revierte el especificado y realiza un commit con el resultado. Esto requiere que el árbol de trabajo esté limpio (sin modificaciones desde el `HEAD` commit)" 88 | }, 89 | "diff --cached": { 90 | "cmd": "diff --cached []", 91 | "docs": "Visualiza los cambios que se han preparado vs el último commit. Se puede pasar un para ver los cambios relativos al mismo." 92 | }, 93 | "commit": { 94 | "cmd": "commit [-m 'msg']", 95 | "docs": "Almacena el contenido actual del index en un nuevo commit acompañado de un mensaje de log que describe esos cambios." 96 | }, 97 | "commit --amend": { 98 | "cmd": "commit --amend", 99 | "docs": "Modifica el último commit con los cambios actuales en el index." 100 | }, 101 | "log": { 102 | "cmd": "log", 103 | "docs": "Muestra los commits recientes, comenzando por los últimos. Optiones:\r`‑‑decorate` para incluir nombres de ramas y tags\r`‑‑stat` para incluir métricas (archivos modificados, insertados, and eliminados) \r`‑‑author=` para filtrar por autor\r`‑‑after=\"MMM DD YYYY\"` ej. (\"Jun 20 2008\") para incluir commits desde esa fecha\r`‑‑before=\"MMM DD YYYY\"` incluye commits anteriores a esa fecha \r`‑‑merge` incluye únicamente los commits involucrados en conflictos de combinación" 104 | }, 105 | "diff x x": { 106 | "cmd": "diff ", 107 | "docs": "Visualizar los cambios entre dos commits arbitrariamente" 108 | }, 109 | "branch": { 110 | "cmd": "branch", 111 | "docs": "Lista todas las ramas existentes. Agregando -r lista las ramas registradas como remotas, la opción -a muestra ambas ramas." 112 | }, 113 | "branch -d x": { 114 | "cmd": "branch -d ", 115 | "docs": "Elimina la rama especificada. Usar -D para forzar esto." 116 | }, 117 | "branch --track x x": { 118 | "cmd": "branch --track ", 119 | "docs": "Crea una nueva rama local que sigue a una rama remota." 120 | }, 121 | "clone x": { 122 | "cmd": "clone ", 123 | "docs": "Descarga el repositorio especificado por y posiciona el `HEAD` en la rama main." 124 | }, 125 | "pull x x": { 126 | "cmd": "pull ", 127 | "docs": "Incorpora los cambios desde un repositorio remoto en la rama actual. En su modo por defecto, `git pull` es un atajo de `git fetch` seguido por `git merge FETCH_HEAD`." 128 | }, 129 | "reset --hard x/x": { 130 | "cmd": "reset --hard /", 131 | "docs": "Equipara el espacio de trabajo y el index con una rama remota. Usar `reset ‑‑hard origin/main` para descartar todos los commits en la rama local main. Se puede utilizar para comenzar de nuevo desde una combinación/merge fallida." 132 | }, 133 | "fetch x x": { 134 | "cmd": "fetch ", 135 | "docs": "Descarga los objetos y referencias desde otro repositorio." 136 | }, 137 | "push": { 138 | "cmd": "push", 139 | "docs": "Actualiza el servidor con los commits de todas ramas que tienen en *COMÚN* entre el repositorio local y el remoto. Las ramas locales que nunca fueron enviadas al server (push) no están compartidas." 140 | }, 141 | "push x x": { 142 | "cmd": "push ", 143 | "docs": "Envía una nueva (o existente) rama al repositorio remoto" 144 | }, 145 | "push x x:x": { 146 | "cmd": "push :", 147 | "docs": "Envía una rama al repositorio remoto con otro nombre" 148 | }, 149 | "branch -r": { 150 | "cmd": "branch -r", 151 | "docs": "Lista las ramas remotas" 152 | }, 153 | "push --delete": { 154 | "cmd": "push --delete ", 155 | "docs": "Elimina una rama remota." 156 | }, 157 | "clean": { 158 | "cmd": "clean", 159 | "docs": "Limpia el árbol de trabajo eliminando de forma recursiva los archivos que no están bajo el control de versionado, comenzando por el directorio actual" 160 | }, 161 | "stash push": { 162 | "cmd": "stash push []", 163 | "docs": "Guarda las modificaciones locales en un nuevo stash, y luego ejecuta git reset ‑‑hard para revertirlas. El es optativo y agrega una descripción adicional al estado. Para realizar una captura rápida, se pueden omitir tanto \"push\" como ." 164 | }, 165 | "stash apply": { 166 | "cmd": "stash apply []", 167 | "docs": "Aplica los cambios del stash especificado en el espacio de trabajo. Por defecto aplica el último stash." 168 | }, 169 | "stash pop": { 170 | "cmd": "stash pop", 171 | "docs": "Aplica los cambios del stash especificado y luego lo elimina de los temporales. Por defecto aplica el último stash." 172 | }, 173 | "stash list": { 174 | "cmd": "stash list", 175 | "docs": "Lista los stashes disponibles actualmente." 176 | }, 177 | "stash show": { 178 | "cmd": "stash show []", 179 | "docs": "Muestra los cambios almacenados en el stash aplicando un diff entre ese stash y su padre original. Por defecto utiliza el último stash." 180 | }, 181 | "stash drop": { 182 | "cmd": "stash drop []", 183 | "docs": "Elimina una entrada del listado de stash. Por defecto elimina el último stash." 184 | }, 185 | "stash clear": { 186 | "cmd": "stash clear", 187 | "docs": "Elimina todos las entradas del stash. IMPORTANTE: estas entradas eliminadas pueden ser irrecuperables luego." 188 | }, 189 | "stash branch x": { 190 | "cmd": "stash branch []", 191 | "docs": "Crea y posiciona `HEAD` en el apuntando al commit del cual el fue creado originalmente, aplicando luego los cambios almacenados en el al nuevo árbol de trabajo. \rSi se realiza exitosamente, y es una referencia tipo stash@{}, el comando elimina el . Cuando no se especifica un , aplica el último. \rEste comando es útil en los casos en que la rama en la que se ejecutó git stash push ha cambiado demasiado por lo que git stash apply fallaría por conflictos. Al aplicar los cambios sobre el commit que fue `HEAD` al momento de ejecutar git stash originalmente, se restauran los cambios sin conflictos." 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": { 3 | "status": { 4 | "cmd": "status", 5 | "docs": "Zeigt: \r• Pfade mit Unterschieden zwischen dem Index und dem aktuellen `HEAD` commit \r• Pfade mit Unterschieden zwischen der Arbeitskopie und dem Index \r• Pfade in der Arbeitskopie, die nicht durch Git verwaltet werden" 6 | }, 7 | "diff": { 8 | "cmd": "diff", 9 | "docs": "Zeigt die Änderungen, die noch nicht dem Index hinzugefügt wurden." 10 | }, 11 | "diff x": { 12 | "cmd": "diff ", 13 | "docs": "Zeigt die Änderungen in der Arbeitskopie im Vergleich zu dem . `HEAD` kann als synonym für den letzten Commit im aktuellen Branch verwendet werden. Wird ein Branch-Name angegeben, wird mit dem letzten Commit auf diesem Branch verglichen" 14 | }, 15 | "add x": { 16 | "cmd": "add ", 17 | "docs": "Fügt neue oder geänderte Dateien oder Verzeichnisse dem Index hinzu." 18 | }, 19 | "add -u": { 20 | "cmd": "add -u", 21 | "docs": "Fügt geänderte (NICHT NEUE) Dateien dem Index hinzu. Das ist ähnlich dem, was ein `git commit -a` vor dem Commit macht." 22 | }, 23 | "rm x": { 24 | "cmd": "rm ", 25 | "docs": "Entfernt eine Datei aus der Arbeitskopie und dem Index." 26 | }, 27 | "mv x": { 28 | "cmd": "mv ", 29 | "docs": "Verschiebt eine Datei in der Arbeitskopie und dem Index." 30 | }, 31 | "commit -a": { 32 | "cmd": "commit -a [-m 'Nachricht']", 33 | "docs": "Fügt automatisch alle geänderten und gelöschte Dateien dem Index hinzu und committet diese dann. Neue Dateien bleiben unberücksichtigt." 34 | }, 35 | "checkout x": { 36 | "cmd": "checkout ", 37 | "docs": "Aktualisiert die Datei oder das Verzeichnis in der Arbeitskopie vom lokalen Repository. Arbeitet auf dem aktuellen Branch." 38 | }, 39 | "reset head x": { 40 | "cmd": "reset HEAD ", 41 | "docs": "Entfernt die aus dem Index, in der Arbeitskopie bleibt die Änderung erhalten." 42 | }, 43 | "reset --soft head^": { 44 | "cmd": "reset --soft HEAD^", 45 | "docs": "Setzt die Arbeitskopie auf den Stand des letzten Commits im lokalen Repository zurück. Der Inhalt im Index bleibt erhalten." 46 | }, 47 | "reset --hard": { 48 | "cmd": "reset --hard", 49 | "docs": "Setzt die Arbeitskopie auf den Stand des letzten Commits im lokalen Repository zurück. WARNUNG: Alle nicht committeten Änderungen und neue Dateien der Arbeitskopie und des Index gehen verloren. Dieses Kommando ist nützlich, wenn ein Merge fehlgeschlagen ist und man von vorne beginnen möchte. Mit dem Parameter `ORIG_HEAD` kann der letzte, erfolgreiche Merge und alle Änderungen danach rückgängig gemacht werden." 50 | }, 51 | "switch": { 52 | "cmd": "switch ", 53 | "docs": "Checkt den in die Arbeitskopie aus. Änderungen bleiben erhalten, so dass sie in den Branch committet werden können." 54 | }, 55 | "checkout -b x": { 56 | "cmd": "checkout -b ", 57 | "docs": "Erzeugt einen neuen Branch und wechselt zu diesem" 58 | }, 59 | "merge x": { 60 | "cmd": "merge ", 61 | "docs": "Mergt Änderungen aus oder in den aktuellen Branch.\rMit `‑‑no-commit` wird kein automatisches Commit durchgeführt. Mit `--no-ff` wird auch dann ein Merge-Commit erzeugt, wenn ein Fast-Forward Merge gemacht werden könnte." 62 | }, 63 | "rebase x": { 64 | "cmd": "rebase ", 65 | "docs": "Alle lokalen Commits werden in einen temporären Bereich verschoben und nacheinander auf den HEAD vom wieder aufgespielt. Wird genutzt, um eigene Änderungen mit dem letzten Stand des Remote Repositories ohne einen Merge Commit zusammenzuführen." 66 | }, 67 | "cherry-pick x": { 68 | "cmd": "cherry-pick ", 69 | "docs": "Integriert Änderungen des s in den aktuellen Branch." 70 | }, 71 | "revert x": { 72 | "cmd": "revert ", 73 | "docs": "Erzeugt einen Commit, der die Änderungen in rückgängig macht." 74 | }, 75 | "diff --cached": { 76 | "cmd": "diff --cached []", 77 | "docs": "Vergleicht die Änderungen im Index mit dem letzten Commit. Wird ein angegeben, wird der Index damit verglichen." 78 | }, 79 | "commit": { 80 | "cmd": "commit [-m 'Nachricht']", 81 | "docs": "Erzeugt einen neuen Commit mit dem Inhalt des Index und der eingegebenen Nachricht." 82 | }, 83 | "commit --amend": { 84 | "cmd": "commit --amend", 85 | "docs": "Fügt den Inhalt des Index dem letzten Commit hinzu. Kann auch genutzt werden, um Parameter des Commits zu ändern." 86 | }, 87 | "log": { 88 | "cmd": "log", 89 | "docs": "Zeigt die Commit-Historie. Parameter: \r`‑‑decorate` zeigt Branch- und Tag-Namen\r`‑‑stat` zeigt die Anzahl der Veränderungen je Datei\r`‑‑author=` zeigt nur Commits des s\r`‑‑after=\"MMM DD YYYY\"` z.B. (`Jun 20 2008`) zeigt nur Commits nach einem bestimmten Zeitpunkt\r`‑‑before=\"MMM DD YYYY\"` zeigt nur Commits vor einem bestimmten Datum\r`‑‑merge` zeigt nur Commits die an einem bestehenden Merge-Konflikt beteiligt sind" 90 | }, 91 | "diff x x": { 92 | "cmd": "diff ", 93 | "docs": "Zeigt die Unterschiede zwischen zwei Commits" 94 | }, 95 | "branch": { 96 | "cmd": "branch", 97 | "docs": "Listet alle existierenden Branches auf. Mit `-r` werden die Remote-Tracking-Branches angezeigt und `-a` listet beide auf." 98 | }, 99 | "branch -d x": { 100 | "cmd": "branch -d ", 101 | "docs": "Löscht den angegebenen . `-D` erzwingt das Löschen." 102 | }, 103 | "branch --track x x": { 104 | "cmd": "branch --track ", 105 | "docs": "Erzeugt einen neuen lokalen Branch, der als Remote-Tracking-Branch verwendet." 106 | }, 107 | "clone x": { 108 | "cmd": "clone ", 109 | "docs": "Kopiert das in ein neues Verzeichnis und checkt den main Branch aus. Der Remote-Tracking-Branch verweist auf das Quell-Repository." 110 | }, 111 | "pull x x": { 112 | "cmd": "pull ", 113 | "docs": "Lädt die Änderungen des aktuellen Branches von seinem origin und überträgt sie in das lokale Repository und die Arbeitskopie. In der Standardkonfiguration ist `git pull` ein Abkürzung für `git fetch` gefolgt von `git merge FETCH_HEAD`." 114 | }, 115 | "reset --hard x/x": { 116 | "cmd": "reset --hard /", 117 | "docs": "Setzt das lokale Repository und die Arbeitskopie auf den Stand des Remote Repositories. Zum Beispiel verwirft `reset ‑‑hard origin/main` alle Änderungen am lokalen main-Branches." 118 | }, 119 | "fetch x x": { 120 | "cmd": "fetch ", 121 | "docs": "Lädt die Änderungen des aktuellen Branches von seinem origin und überträgt sie in das lokale Repository. Die Arbeitskopie bleibt unverändert. Das ist nützlich, um den eigenen Stand mit dem Remote-Stand zu vergleichen." 122 | }, 123 | "push": { 124 | "cmd": "push", 125 | "docs": "Überträgt die neuen Commits des lokalen Repositories für den aktuellen Branches in das Remote Repository. `--all` überträgt die Commits aller Branches." 126 | }, 127 | "push x x": { 128 | "cmd": "push ", 129 | "docs": "Überträgt einen neuen (oder existierenden) Branch in das Remote Repository" 130 | }, 131 | "push x x:x": { 132 | "cmd": "push :", 133 | "docs": "Überträgt einen neuen Branch mit einem anderen Namen in das Remote Repository." 134 | }, 135 | "branch -r": { 136 | "cmd": "branch -r", 137 | "docs": "Zeigt die Branches des Remote Repositories" 138 | }, 139 | "push --delete": { 140 | "cmd": "push --delete ", 141 | "docs": "Löscht den Branch im Remote Repository." 142 | }, 143 | "clean": { 144 | "cmd": "clean", 145 | "docs": "Löscht (rekursiv, vom aktuellen Verzeichnis) alle Dateien der Arbeitskopie, die nicht unter Versionskontrolle stehen (die sich noch nicht im lokalen Repository oder im Index befinden). `-n` führt einen \"dry run\" durch und zeigt an, welche Dateien gelöscht werden würden. `-f` führt das Löschen aus." 146 | }, 147 | "stash push": { 148 | "cmd": "stash push []", 149 | "docs": "Speichert aktuelle Änderungen der Arbeitskopie in einem neuen \"Stash\" und ruft `git reset ‑‑hard` auf. Die ist optional, wird keine angegeben kann `push` auch weggelassen werden." 150 | }, 151 | "stash apply": { 152 | "cmd": "stash apply []", 153 | "docs": "Fügt die Änderungen des angegebenen in die Arbeitskopie ein. Wird nicht angegeben, wird der zuletzt erstellte verwendet." 154 | }, 155 | "stash pop": { 156 | "cmd": "stash pop", 157 | "docs": "Fügt die Änderungen des letzten Stash in die Arbeitskopie ein und entfernt den Stash." 158 | }, 159 | "stash list": { 160 | "cmd": "stash list", 161 | "docs": "Zeigt alle vorhandenen Stashes an." 162 | }, 163 | "stash show": { 164 | "cmd": "stash show []", 165 | "docs": "Zeigt die Änderungen des im Vergleich zum ursprünglichen Zustand. Wenn kein angegeben ist, wird der neueste verwendet." 166 | }, 167 | "stash drop": { 168 | "cmd": "stash drop []", 169 | "docs": "Löscht einen vorhandenen \"Stash\". Wird kein angegeben, wird der neueste gelöscht." 170 | }, 171 | "stash clear": { 172 | "cmd": "stash clear", 173 | "docs": "Lösche alle vorhandenen \"Stashes\"." 174 | }, 175 | "stash branch x": { 176 | "cmd": "stash branch []", 177 | "docs": "Erzeugt einen neuen und checkt diesen aus. Der Branch zweigt von dem Commit ab, auf dem der basiert. Die Änderungen des Stashes werden dann in die Arbeitskopie des neuen Branches eingespielt.\rWenn das erfolgreich ist und der eine Referenz in der Form stash@{} ist, dann wird der entfernt. Wenn nicht angegeben ist, wird der neueste verwendet.\rDas ist nützlich, wenn sich der Branch auf dem der Stash eingespielt werden soll, so stark verändert hat, dass `git stash apply` aufgrund von Konflikten fehlschlägt. Da der Stash mit diesem Kommando auf dem ursprünglichen Commit zum Zeitpunkt von `git stash` eingespielt wird, wird so der Originalzustand des Stashes ohne Konflikte wiederhergestellt." 178 | } 179 | }, 180 | "locations": { 181 | "stash": "Stash", 182 | "workspace": "Arbeitskopie", 183 | "index": "Index", 184 | "local_repo": "Lokales Repository", 185 | "remote_repo": "Remote Repository", 186 | "docs": { 187 | "stash": "Hier können Änderungen \"geparkt\" werden, während man an etwas anderem arbeitet", 188 | "workspace": "Checkout des lokalen Repositories", 189 | "index": "Zu commitende Dateien. Vor einem \"commit\" (checkin), müssen die Dateien zuerst zu dem Index hinzugefügt werden. Wird auch \"staging area\" oder \"staged files\" genannt.", 190 | "local_repo": "Der lokale clone des Remote Repositories. Es wird in dem Verzeichnis `.git` verwaltet. Typische Branches sind: `main`, `feature-x`, `bugfix-y`", 191 | "remote_repo": "Der Ursprung des lokalen Repositories. Durch ein `clone` wird es automatisch als `origin` gesetzt." 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "locations": { 3 | "stash": "REMISE", 4 | "workspace": "ESPACE DE TRAVAIL", 5 | "index": "INDEX", 6 | "local_repo": "DÉPÔT LOCAL", 7 | "remote_repo": "DÉPÔT DISTANT", 8 | "docs": { 9 | "stash": "Un endroit où remiser des modifications pendant que vous travaillez sur autre chose", 10 | "workspace": "L'espace de travail local", 11 | "index": "L'index (ou \"zone de transit\") maintient un instantané de l'espace de travail qui servira de base pour le prochain commit.", 12 | "local_repo": "Un sous-répertoire nommé .git qui contient tous les fichiers nécessaires au référentiel. Branches typiques : `main`, `fonction-x`, `correctif-y`", 13 | "remote_repo": "Versions de votre projet qui sont hébergés sur le réseau ou Internet, pour mettre toutes vos modifications à la disposition d'autres développeurs. Par défaut . Branches typiques : `main`, `fonction-x-partagée`, `version-y`" 14 | } 15 | }, 16 | "commands": { 17 | "status": { 18 | "cmd": "status", 19 | "docs": "Affiche les chemins des fichiers qui diffèrent entre l'INDEX et la TÊTE du commit courant, ceux des fichiers qui diffèrent entre l'ESPACE_DE_TRAVAIL et l'INDEX, et ceux des fichiers qui sont dans l'ESPACE_DE_TRAVAIL mais ne sont pas encore suivis par git." 20 | }, 21 | "diff": { 22 | "cmd": "diff", 23 | "docs": "Affiche les différences entre l'ESPACE_DE_TRAVAIL et l'INDEX." 24 | }, 25 | "diff x": { 26 | "cmd": "diff ", 27 | "docs": "Affiche les différences entre l'ESPACE_DE_TRAVAIL et le COMMIT ou la BRANCHE spécifié. Vous pouvez utiliser TÊTE pour comparer avec le dernier commit." 28 | }, 29 | "add x": { 30 | "cmd": "add ", 31 | "docs": "Ajoute à l'INDEX le contenu des FICHIER(S) ou DOSSIER(S), nouveaux ou modifiés, les plaçant ainsi en attente d'inclusion dans le prochain commit. Utilisez 'git add --interactive' pour ajouter de manière interactive à l'INDEX les contenus modifiés dans l'ESPACE_DE_TRAVAIL." 32 | }, 33 | "add -u": { 34 | "cmd": "add -u", 35 | "docs": "Ajoute à l'INDEX le contenu des fichiers (ÉXISTANTS) modifiés. C'est ce que fait 'git commit -a' en préparation à un commit." 36 | }, 37 | "rm x": { 38 | "cmd": "rm ", 39 | "docs": "Supprime des FICHIER(S) de l'ESPACE_DE_TRAVAIL et de l'INDEX." 40 | }, 41 | "mv x": { 42 | "cmd": "mv ", 43 | "docs": "Déplace des FICHIER(S) de l'ESPACE_DE_TRAVAIL et de l'INDEX." 44 | }, 45 | "commit -a": { 46 | "cmd": "commit -a [-m 'message']", 47 | "docs": "Fait un commit de tous les fichiers qui ont changé depuis le dernier commit, à l'exception des fichiers non suivis (ie. tous les fichiers qui sont dans l'INDEX). Supprime de l'INDEX les fichiers qui ont été supprimés de l'ESPACE_DE_TRAVAIL." 48 | }, 49 | "checkout x": { 50 | "cmd": "checkout ", 51 | "docs": "Met à jour les FICHIER(S) ou DOSSIER(S) dans l'ESPACE_DE_TRAVAIL en écrasant toutes les modifications locales. Ne PAS changer de branches." 52 | }, 53 | "switch": { 54 | "cmd": "switch ", 55 | "docs": "Échange les branches en mettant à jour l'ESPACE_DE_TRAVAIL et l'INDEX pour charger la BRANCHE spécifiée en positionnant la TÊTE dessus." 56 | }, 57 | "reset head x": { 58 | "cmd": "reset HEAD ", 59 | "docs": "Supprime les FICHIER(S) spécifiés du prochain commit. Réinitialise l'INDEX mais pas l'ESPACE_DE_TRAVAIL (i.e. les fichiers modifiés sont préservés mais non marqués pour commit) et indique ce qui n'a pas été mis à jour." 60 | }, 61 | "reset --soft head^": { 62 | "cmd": "reset --soft HEAD^", 63 | "docs": "Défait le dernier commit en laissant les modifications dans l'INDEX." 64 | }, 65 | "reset --hard": { 66 | "cmd": "reset --hard", 67 | "docs": "Fait correspondre l'ESPACE_DE_TRAVAIL et l'INDEX avec le DÉPÔT_LOCAL. ATTENTION : toutes les modifications apportées à des fichiers suivis dans l'ESPACE_DE_TRAVAIL depuis le dernier commit sont perdues. Utilisez ceci lorsqu'une fusion a engendré des conflits et que vous souhaitez recommencer. Précisez `ORIG_HEAD` pour défaire la dernière fusion réussie et les modifications qui ont suivi." 68 | }, 69 | "checkout -b x": { 70 | "cmd": "checkout -b ", 71 | "docs": "Crée une nouvelle BRANCHE et se positionne dessus." 72 | }, 73 | "merge x": { 74 | "cmd": "merge ", 75 | "docs": "Fusionne les modifications du COMMIT ou de la BRANCHE dans la branche courante. Utilisez --no-commit pour ignorer les modifications n'ayant pas encore fait l'objet d'un commit." 76 | }, 77 | "rebase x": { 78 | "cmd": "rebase ", 79 | "docs": "Défait tous les commits effectués depuis que la branche à divergé de SOURCE puis les refait tous un par un sur les modifications apportées à la TÊTE de SOURCE." 80 | }, 81 | "cherry-pick x": { 82 | "cmd": "cherry-pick ", 83 | "docs": "Intègre les modifications du COMMIT spécifié dans la branche courante." 84 | }, 85 | "revert x": { 86 | "cmd": "revert ", 87 | "docs": "Défait le COMMIT spécifié puis fait un commit du résultat. Cela nécessite que l'ESPACE_DE_TRAVAIL soit propre (sans modifications sur la TÊTE du commit)." 88 | }, 89 | "diff --cached": { 90 | "cmd": "diff --cached [commit]", 91 | "docs": "Montre les modifications que vous avez placé dans la REMISE par rapport au dernier commit. Vous pouvez préciser un COMMIT pour voir juste les modifications le concernant." 92 | }, 93 | "commit": { 94 | "cmd": "commit [-m 'message']", 95 | "docs": "Enregistre le contenu de l'INDEX dans un nouveau commit en y associant un message utilisateur décrivant les modifications." 96 | }, 97 | "commit --amend": { 98 | "cmd": "commit --amend", 99 | "docs": "Modifie le dernier commit en y apportant les modifications se trouvant dans l'INDEX." 100 | }, 101 | "log": { 102 | "cmd": "log", 103 | "docs": "Montre les commits récents, les plus récents au début. Options : --decorate avec les noms de branches et d'étiquettes sur les commits, --stat avec des statistiques (fichiers modifiés, insertions et suppressions), --author=AUTEUR seuleument d'un certain AUTEUR, --after=\"MMM JJ AAAA\" ex. (\"Jun 20 2008\") limité aux commits faits après une certaine date, --before=\"MMM JJ AAAA\" limité aux commits faits avant une certaine date, --merge limité aux commits concernés par les conflits de fusion courants." 104 | }, 105 | "diff x x": { 106 | "cmd": "diff ", 107 | "docs": "Montre les modifications entre deux commits." 108 | }, 109 | "branch": { 110 | "cmd": "branch", 111 | "docs": "Liste les branches locales existantes. L'option -r permet de lister les branches distantes et l'option -a montre les branches locales et distantes." 112 | }, 113 | "branch -d x": { 114 | "cmd": "branch -d ", 115 | "docs": "Supprime la BRANCHE spécifiée. Utilisez -D pour forcer la suppression." 116 | }, 117 | "branch --track x x": { 118 | "cmd": "branch --track ", 119 | "docs": "Crée une BRANCHE locale qui suit la branche_distante." 120 | }, 121 | "clone x": { 122 | "cmd": "clone ", 123 | "docs": "Télécharge le DÉPÔT_DISTANT et se positionne sur la TÊTE de sa branche main." 124 | }, 125 | "pull x x": { 126 | "cmd": "pull ", 127 | "docs": "Récupère les modifications associées à la référence du DÉPÔT_DISTANT et les fusionne dans la branche courante." 128 | }, 129 | "reset --hard x/x": { 130 | "cmd": "reset --hard ", 131 | "docs": "Réinitialise l'ESPACE_DE_TRAVAIL et le DÉPÔT_LOCAL pour les faire correspondre à la BRANCHE du DÉPÔT_DISTANT. Utilisez 'git reset --hard origin/main' pour rejeter tous les commits du DÉPÔT_LOCAL. Utilisez ceci pour reprendre après une fusion qui a échoué." 132 | }, 133 | "fetch x x": { 134 | "cmd": "fetch ", 135 | "docs": "Télécharge les objets et les références associés à la référence du DÉPÔT_DISTANT." 136 | }, 137 | "push": { 138 | "cmd": "push", 139 | "docs": "Met à jour le serveur en appliquant les commits sur toutes les branches *COMMUNNES* au DÉPÔT_LOCAL et au serveur. Les branches locales qui n'ont jamais été poussées sur le serveur ne sont pas partagées." 140 | }, 141 | "push x x": { 142 | "cmd": "push ", 143 | "docs": "Pousse la BRANCHE spécifiée vers le DÉPÔT_DISTANT." 144 | }, 145 | "push x x:x": { 146 | "cmd": "push :", 147 | "docs": "Pousse la nouvelle BRANCHE_1 vers le DÉPÔT_DISTANT en la renommant BRANCHE_2." 148 | }, 149 | "branch -r": { 150 | "cmd": "branch -r", 151 | "docs": "Liste les branches distantes." 152 | }, 153 | "push --delete": { 154 | "cmd": "push --delete ", 155 | "docs": "Supprime la BRANCHE du DÉPÔT_DISTANT." 156 | }, 157 | "clean": { 158 | "cmd": "clean", 159 | "docs": "Nettoie l'ESPACE_DE_TRAVAIL en supprimant récursivement les fichiers qui ne sont pas sous le contrôle de version, en commençant par le répertoire courant." 160 | }, 161 | "stash push": { 162 | "cmd": "stash push ['message']", 163 | "docs": "Enregistre les modifications locales dans la REMISE puis fait un 'git reset --hard' pour les défaire. Le `message` optionnel donne la description associée à l'état enregistré dans la REMISE. Pour faire un instantanné rapide, vous pouvez omettre à la fois \"push\" et le `message`." 164 | }, 165 | "stash apply": { 166 | "cmd": "stash apply [état]", 167 | "docs": "Déplace les modifications associées à l'ÉTAT de la REMISE vers l'ESPACE_DE_TRAVAIL. La dernière REMISE est prise par défaut." 168 | }, 169 | "stash pop": { 170 | "cmd": "stash pop", 171 | "docs": "Applique les modifications du dernier état de la REMISE puis les supprime de la REMISE." 172 | }, 173 | "stash list": { 174 | "cmd": "stash list", 175 | "docs": "Liste les états dans la REMISE." 176 | }, 177 | "stash show": { 178 | "cmd": "stash show [état]", 179 | "docs": "Montre les modifications associées à l'ÉTAT spécifié sous la forme d'un diff entre l'ÉTAT et son parent initial. Lorsqu'aucun ÉTAT n'est précisé, le dernier est montré." 180 | }, 181 | "stash drop": { 182 | "cmd": "stash drop [état]", 183 | "docs": "Supprime l'ÉTAT de la REMISE. Lorsqu'aucun ÉTAT n'est précisé, le dernier est supprimé." 184 | }, 185 | "stash clear": { 186 | "cmd": "stash clear", 187 | "docs": "Supprime tous les états de la REMISE. Notez que ces états seront alors candidats à l'élagage et pourront être impossible à restaurer." 188 | }, 189 | "stash branch x": { 190 | "cmd": "stash branch [état]", 191 | "docs": "Crée et charge une nouvelle BRANCHE à partir du commit d'où provient l'ÉTAT puis applique les modifications enregistrées dans l'ÉTAT aux nouveaux ESPACE_DE_TRAVAIL et INDEX. Si cela réussit, l'ÉTAT devient une référence de la forme ÉTAT@{RÉVISION} et l'ÉTAT est supprimé. Lorsqu'aucun ÉTAT n'est donné, le dernier est appliqué. Ceci est utile si une branche sur laquelle vous avez fait un 'stash' a suffisemment changée pour que 'stash apply' échoue à cause de conflits. Puisque l'état est apliqué sur le commit qui était en TÊTE au moment où le 'stash' a été effectué, l'état original est restauré sans conflits." 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": { 3 | "status": { 4 | "cmd": "status", 5 | "docs": "Elenca: \r• i file che presentano differenze tra l'indice e il workspace\r• i file che presentano differenze tra l'indice e l'`HEAD` attuale\r• i file del workspace che non sono tracciati da git." 6 | }, 7 | "diff": { 8 | "cmd": "diff", 9 | "docs": "Elenca le differenze tra il workspace e l'indice." 10 | }, 11 | "diff x": { 12 | "cmd": "diff ", 13 | "docs": "Elenca i cambiamenti tra il workspace ed il specificato. È possibile utilizzare `HEAD` per considerare l'ultimo commit, o specificare il nome di un branch." 14 | }, 15 | "add x": { 16 | "cmd": "add ", 17 | "docs": "Aggiunge i file specificati (nuovi o modificati) all'indice, così da prepararli al prossimo commit. Si può usare `add --interactive` per aggiungere file all'indice in maniera interattiva." 18 | }, 19 | "add -u": { 20 | "cmd": "add -u", 21 | "docs": "Aggiunge solamente i file modificati (NON QUELLI NUOVI) all'indice. Simile a ciò che il comando `git commit -a` fa in preparazione di un nuovo commit." 22 | }, 23 | "rm x": { 24 | "cmd": "rm ", 25 | "docs": "Rimuove uno o più file dal workspace e dall'indice." 26 | }, 27 | "mv x": { 28 | "cmd": "mv ", 29 | "docs": "Sposta uno o più file nel workspace e nell'indice." 30 | }, 31 | "commit -a": { 32 | "cmd": "commit -a [-m 'msg']", 33 | "docs": "Esegue un commit di tutti i file modificati dal commit precedente, eccetto quelli non tracciati (i.e. esegue un commit dei soli file che sono già presenti nell'indice). Rimuove dall'indice i file che sono stati rimossi dal workspace." 34 | }, 35 | "checkout x": { 36 | "cmd": "checkout ", 37 | "docs": "Aggiorna i file o le directory nel workspace. NON cambia branch." 38 | }, 39 | "reset head x": { 40 | "cmd": "reset HEAD ", 41 | "docs": "Rimuove i file specificati dal commit successivo. Esegue un reset dell'indice, ma non del workspace (i.e. le modifiche ai file vengono mantenute, ma non sono considerate nel commit) e segnala cosa non è stato aggiornato." 42 | }, 43 | "reset --soft head^": { 44 | "cmd": "reset --soft HEAD^", 45 | "docs": "Annulla l'ultimo commit, mantenendo i cambiamenti nell'indice." 46 | }, 47 | "reset --hard": { 48 | "cmd": "reset --hard", 49 | "docs": "Uguaglia il workspace e l'indice allo stato del repository locale. ATTENZIONE: I cambiamenti dei file nel workspace dall'ultimo commit verranno persi. Usare questo comando è utile se un'operazione di merge ha presentato dei conflitti e si intente procedere da capo. È possibile specificare `ORIG_HEAD` per annullare l'ultimo merge effettuato con successo e qualsiasi cambiamento successivo ad esso." 50 | }, 51 | "switch": { 52 | "cmd": "switch ", 53 | "docs": "Cambia il branch corrente. Aggiorna il workspace e l'indice per riflettere lo stato del branch specificato e sposta l'`HEAD` su ." 54 | }, 55 | "checkout -b x": { 56 | "cmd": "checkout -b ", 57 | "docs": "Crea un nuovo branch e ci si posiziona." 58 | }, 59 | "merge x": { 60 | "cmd": "merge ", 61 | "docs": "Unisce i cambiamenti di o di nel branch corrente.\rSpecificare `‑‑no-commit` per non eseguire il commit al termine del comando.\rSpecificare `--no-ff` per creare un nuovo commit di merge anche se si tratta di un fast forward." 62 | }, 63 | "rebase x": { 64 | "cmd": "rebase ", 65 | "docs": "Annulla tutti i commit del branch corrente che divergono da , per poi riapplicarli uno ad uno a partire dall'`HEAD` di ." 66 | }, 67 | "cherry-pick x": { 68 | "cmd": "cherry-pick ", 69 | "docs": "Integra i cambiamenti del commit specificato nel branch corrente." 70 | }, 71 | "revert x": { 72 | "cmd": "revert ", 73 | "docs": "Inverte il commit specificato e crea un nuovo commit con il risultato. Occorre che il workspace sia pulito (i.e. nessuna nuova modifica dall'`HEAD`)." 74 | }, 75 | "diff --cached": { 76 | "cmd": "diff --cached []", 77 | "docs": "Elenca le differenze tra l'indice e l'ultimo commit. Specificare un per elencare i cambiamenti relativi ad esso." 78 | }, 79 | "commit": { 80 | "cmd": "commit [-m 'msg']", 81 | "docs": "Memorizza il contenuto corrente dell'indice in un nuovo commit.\rIl messaggio ne descrive i cambiamenti." 82 | }, 83 | "commit --amend": { 84 | "cmd": "commit --amend", 85 | "docs": "Modifica l'ultimo commit con lo stato attuale dell'indice." 86 | }, 87 | "log": { 88 | "cmd": "log", 89 | "docs": "Elenca gli ultimi commit, i più recenti in cima. Opzioni:\r`‑‑decorate` aggiunge il nome dei branch ed i tag ai commit\r`‑‑stat` aggiunge statistiche (file modificati, inseriti ed eliminati) \r`‑‑author=` filtra per autore\r`‑‑after=\"MMM DD YYYY\"` es. (`Jun 20 2008`) filtra per specifica data\r`‑‑before=\"MMM DD YYYY\"` filtra per date inferiori a quella specificata \r`‑‑merge` mostra solo i commit coinvolti nel merge attuale." 90 | }, 91 | "diff x x": { 92 | "cmd": "diff ", 93 | "docs": "Elenca i cambiamenti tra due commit specificati." 94 | }, 95 | "branch": { 96 | "cmd": "branch", 97 | "docs": "Elenca tutti i branch esistenti. L'opzione `-r` elenca solamente i branch remoti, l'opzione `-a` elenca sia quelli remoti che quelli locali." 98 | }, 99 | "branch -d x": { 100 | "cmd": "branch -d ", 101 | "docs": "Elimina il branch specificato. L'opzione `-D` forza l'eliminazione." 102 | }, 103 | "branch --track x x": { 104 | "cmd": "branch --track ", 105 | "docs": "Crea un nuovo branch locale a partire da un branch remoto." 106 | }, 107 | "clone x": { 108 | "cmd": "clone ", 109 | "docs": "Effettua il download del repository specificato e si posiziona sull'`HEAD` del main branch." 110 | }, 111 | "pull x x": { 112 | "cmd": "pull ", 113 | "docs": "Incorpora i cambiamenti di un repository remoto nel branch locale corrente. Di default, `git pull` è un'abbreviazione del comando `git fetch` seguito dal comando `git merge FETCH_HEAD`." 114 | }, 115 | "reset --hard x/x": { 116 | "cmd": "reset --hard /", 117 | "docs": "Ripristina il workspace ed il repository locale allo stato del branch remoto specificato. Utilizzare `reset ‑‑hard origin/main` per cancellare tutti i commit del main branch locale. Utile per procedere da capo dopo un tentativo di merge fallito." 118 | }, 119 | "fetch x x": { 120 | "cmd": "fetch ", 121 | "docs": "Effettua il download di file e riferimenti da un altro repository." 122 | }, 123 | "push": { 124 | "cmd": "push", 125 | "docs": "Aggiorna il server con i commit locali in tutti i branch che sono *IN COMUNE* tra il repository locale ed il server. I branch locali che non sono mai stati inviati al server non sono condivisi." 126 | }, 127 | "push x x": { 128 | "cmd": "push ", 129 | "docs": "Invia un nuovo (o già esistente) branch al repository remoto." 130 | }, 131 | "push x x:x": { 132 | "cmd": "push :", 133 | "docs": "Invia un nuovo branch al repository remoto con un nome differente." 134 | }, 135 | "branch -r": { 136 | "cmd": "branch -r", 137 | "docs": "Elenca i branch remoti." 138 | }, 139 | "push --delete": { 140 | "cmd": "push --delete ", 141 | "docs": "Elimina un branch remoto." 142 | }, 143 | "clean": { 144 | "cmd": "clean", 145 | "docs": "Pulisce il workspace eliminando ricorsivamente i file che non sono tracciati da git, partendo dalla directory corrente. Specificare `-n` per un \"dry run\" e vedere cosa verrà eliminato. Specificare `-f` per eliminare i file." 146 | }, 147 | "stash push": { 148 | "cmd": "stash push []", 149 | "docs": "Salva le modifiche locali in un nuovo stash, ed esegue il comando `git reset ‑‑hard` per invertirle. Il messaggio è opzionale e dà una descrizione dello stato dello stash. Per velocizzare l'operazione, è possibile omettere `push` e ." 150 | }, 151 | "stash apply": { 152 | "cmd": "stash apply []", 153 | "docs": "Applica i cambiamenti dello stash specificato nel workspace. Se lo non è specificato, viene considerato l'ultimo aggiunto." 154 | }, 155 | "stash pop": { 156 | "cmd": "stash pop", 157 | "docs": "Applica i cambiamenti dell'ultimo stash (o quello specificato) nel workspace e successivamente lo elimina." 158 | }, 159 | "stash list": { 160 | "cmd": "stash list", 161 | "docs": "Elenca tutti gli stash salvati." 162 | }, 163 | "stash show": { 164 | "cmd": "stash show []", 165 | "docs": "Mostra i cambiamenti tra il contenuto di e lo stato del workspace da cui esso è stato originato. Se lo non è specificato, viene considerato l'ultimo aggiunto." 166 | }, 167 | "stash drop": { 168 | "cmd": "stash drop []", 169 | "docs": "Elimina uno stash. Se lo non è specificato, viene considerato l'ultimo aggiunto." 170 | }, 171 | "stash clear": { 172 | "cmd": "stash clear", 173 | "docs": "Elimina tutti gli stash. ATTENZIONE: gli stash eliminati potrebbero essere impossibili da recuperare." 174 | }, 175 | "stash branch x": { 176 | "cmd": "stash branch []", 177 | "docs": "Crea un nuovo branch chiamato e ci si posiziona, partendo dal commit da cui è stato generato lo ed applicando i cambiamenti conservati in esso nell'indice e nel nuovo workspace. \rSe l'operazione ha successo, e lo è un riferimento del tipo stash@{}, lo viene eliminato. Se lo non è specificato, viene considerato l'ultimo aggiunto. \rQuesto comando è utile se il branch da cui è stato lanciato `git stash push` è cambiato tanto da far fallire `git stash apply` a causa di conflitti. Poiché lo stash viene applicato in cima al commit `HEAD` precedente al comando `git stash`, lo stato originale viene ripristinato senza conflitti." 178 | } 179 | }, 180 | "locations": { 181 | "stash": "stash", 182 | "workspace": "workspace", 183 | "index": "index", 184 | "local_repo": "repository locale", 185 | "remote_repo": "repository remoto", 186 | "docs": { 187 | "stash": "Uno spazio in cui conservare le modifiche mentre si lavora a qualcos'altro.", 188 | "workspace": "Lo spazio di lavoro locale (la cartella nella quale si lavora). Spesso è noto anche come \"working tree\".", 189 | "index": "Uno spazio che contiene i file pronti per essere committati. Spesso è noto anche come \"current directory cache\", \"cache\" o \"staging area\". I file al suo interno spesso sono noti anche come \"staged files\".", 190 | "local_repo": "Uno spazio che contiene tutti i file committati e le informazioni sui branch. Si presenta come una sotto-cartella denominata `.git`. I nomi tipici per i branch usati qui sono: `main`, `feature-x`, `bugfix-y`.", 191 | "remote_repo": "Uno spazio online che contiene tutte le varie versioni del progetto, accessibile anche agli altri sviluppatori. Il nome usato per identificare un repository remoto di solito è `origin`. I nomi tipici per i branch usati qui sono: `main`, `shared-feature-x`, `release-y`." 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "dir": "ltr", 3 | "commands": { 4 | "status": { 5 | "cmd": "status", 6 | "docs": "Mosta: \r• Diferenças entre os arquivos na fila (staging ou index) e o commit atual `HEAD`, \r• Diferenças entre os arquivos na máquina local (workspace) e na fila (index), e \r• arquivos na máquina local que não são rastreados pelo git." 7 | }, 8 | "diff": { 9 | "cmd": "diff", 10 | "docs": "Mosta a diferença entre os arquivos que ainda não foram adicionados à fila (index)." 11 | }, 12 | "diff x": { 13 | "cmd": "diff ", 14 | "docs": "Visualiza as diferenças que há entre o código na máquina local (workspace) relativo ao número do commit. É possível usar `HEAD` para comparar com o último commit, ou uma branch para comparar com outra." 15 | }, 16 | "add x": { 17 | "cmd": "add ", 18 | "docs": "Adiciona as modificações da máquina local (workspace) à fila, preparando-as para serem inclusas no próximo commit. Use `add --interactive` para adicionar modificações da máquina local de forma interativa." 19 | }, 20 | "add -u": { 21 | "cmd": "add -u", 22 | "docs": "Adds the current content of modified (NOT NEW) files to the index. This is similar to what `git commit -a` does in preparation for making a commit." 23 | }, 24 | "rm x": { 25 | "cmd": "rm ", 26 | "docs": "Remove um arquivo da máquina local (workspace) e da fila (index)." 27 | }, 28 | "mv x": { 29 | "cmd": "mv ", 30 | "docs": "Move arquivos na maquina local (workspace) e na fila (index)." 31 | }, 32 | "commit -a": { 33 | "cmd": "commit -a [-m 'msg']", 34 | "docs": "Commit all files changed since your last commit, except untracked files (i.e. all files that are already listed in the index). Remove files in the index that have been removed from the workspace." 35 | }, 36 | "checkout x": { 37 | "cmd": "checkout ", 38 | "docs": "Atualiza o arquivo ou diretório da máquina local (workspace). NÃO muda de branch." 39 | }, 40 | "reset head x": { 41 | "cmd": "reset HEAD ", 42 | "docs": "Remove os arquivos especificados do próximo commit. Reseta a fila (index) mas não do diretório de trabalho. Em outras palavras, os arquivos alterados são preservados, mas não marcados para commit) e relata o que não foi atualizado." 43 | }, 44 | "reset --soft head^": { 45 | "cmd": "reset --soft HEAD^", 46 | "docs": "Desfaz o último commit, deixando as alterações na máquina local (workspace), sem serem commitadas." 47 | }, 48 | "reset --hard": { 49 | "cmd": "reset --hard", 50 | "docs": "Força todas as alterações na máquina local (workspace) e na fila à ficarem igual ao diretório atual. AVISO: Quaisquer arquivos modificados serão perdidos desde o commit. Use apenas se houver conflitos de merge e deseja recomeçar do zero a resolução. Passe o último commit no repositório remoto, `ORIGIN HEAD` para apagar todas as alterações após último merge feito com sucesso no repositório remoto." 51 | }, 52 | "switch": { 53 | "cmd": "switch ", 54 | "docs": "Muda da branch atual para branch escolhida, , e atualizando `HEAD` para ." 55 | }, 56 | "checkout -b x": { 57 | "cmd": "checkout -b ", 58 | "docs": "Cria uma nova branch e muda para ela." 59 | }, 60 | "merge x": { 61 | "cmd": "merge ", 62 | "docs": "Realiza o merge da para a branch atual. \rUse `--no-commit` para deixar as modificações intactas (sem serem commitadas). Use `--no-ff` para criar um commit de merge mesmo se o merge puder ser feito com o método fast foward." 63 | }, 64 | "rebase x": { 65 | "cmd": "rebase ", 66 | "docs": "Reaplicar os commits na em cima de outra branch base." 67 | }, 68 | "cherry-pick x": { 69 | "cmd": "cherry-pick ", 70 | "docs": "Aplica o na branch atual." 71 | }, 72 | "revert x": { 73 | "cmd": "revert ", 74 | "docs": "Desfaz o commit e commita o resultado novamente. Esta ação requer que não haja modificações no diretório atual (sem modificações no commit `HEAD`)." 75 | }, 76 | "diff --cached": { 77 | "cmd": "diff --cached []", 78 | "docs": "Visualiza as modificações na fila vs o último commit. É possível passar um específico para visualizar as alterações relativas à ele." 79 | }, 80 | "commit": { 81 | "cmd": "commit [-m 'msg']", 82 | "docs": "Grava as modificações que estavam na fila (index) em um commit junto com uma mensagem de log do usuário, descrevendo as modificações." 83 | }, 84 | "commit --amend": { 85 | "cmd": "commit --amend", 86 | "docs": "Adiciona as modificações na fila (index) ao último commit." 87 | }, 88 | "log": { 89 | "cmd": "log", 90 | "docs": "Mosta os últimos commits, os mais recentes acima. Opções:\r `--decorate` com nome da branch e tags nos commits\r`--stat` com status do commit (arquivos alterados, inserções e deleções)\r`--author= commits apenas de um determinado autor\r`--after=\"MMM DD YYYY\" exemplo: (`Jun 20 2021`) somente commits após certa data\r`--before=\"MMM DD YYYY\"` somene commit depois de cereta data\r`--merge` apenas commits envolvidos no conflito de merge." 91 | }, 92 | "diff x x": { 93 | "cmd": "diff ", 94 | "docs": "Visualiza a diferença entre dois commits" 95 | }, 96 | "branch": { 97 | "cmd": "branch", 98 | "docs": "Lista todas as branches locais disponíveis. Opção `-r` mostra as branches remotas, e `-a` ambas." 99 | }, 100 | "branch -d x": { 101 | "cmd": "branch -d ", 102 | "docs": "Deleta uma branch específica. Use `-D` para forçar a deleção mesmo sem ter realizado o merge." 103 | }, 104 | "branch --track x x": { 105 | "cmd": "branch --track /", 106 | "docs": "Cria uma branch local a partir de uma branch remota." 107 | }, 108 | "clone x": { 109 | "cmd": "clone ", 110 | "docs": "Realiza o download do repositório sempre a partir da branch remota padrão definida." 111 | }, 112 | "pull x x": { 113 | "cmd": "pull ", 114 | "docs": "Traz as modificações do repositório remoto para a branch local atual. No modo padrão, `git pull` é uma combinação de `git fetch` seguido de `git merge`." 115 | }, 116 | "reset --hard x/x": { 117 | "cmd": "reset --hard /", 118 | "docs": "Reseta a branch local para ser igual à branch remota. Use `--hard origin/main` para descartar todos os commits feitos na branch local. AVISO: use este comando apenas para reiniciar um conflito de merge falho." 119 | }, 120 | "fetch x x": { 121 | "cmd": "fetch ", 122 | "docs": "Realiza download dos objetos e referências do repositório remoto." 123 | }, 124 | "push": { 125 | "cmd": "push", 126 | "docs": "Envia ao servidor remoto os commits em todas as branches que são **COMUNS** entre a máquina local e o servidor. As branches locais que não estão no servidor não são compartilhadas." 127 | }, 128 | "push x x": { 129 | "cmd": "push ", 130 | "docs": "Envia uma branch local nova (ou existente) para o servidor remoto." 131 | }, 132 | "push x x:x": { 133 | "cmd": "push :", 134 | "docs": "Envia uma branch local ao servidor com um nome diferente. é o nome da branch local, e é o nome da branch no repositório remoto." 135 | }, 136 | "branch -r": { 137 | "cmd": "branch -r", 138 | "docs": "Lista todas as branches remotas." 139 | }, 140 | "push --delete": { 141 | "cmd": "push --delete ", 142 | "docs": "Remove uma branch remota." 143 | }, 144 | "clean": { 145 | "cmd": "clean", 146 | "docs": "Limpa o diretório atual removendo de forma recursiva arquivos não rastreados pelo git (untracked), começando do diretório atual. Use `-n` para verificar previamente quais arquivos seriam deletados. Use `-f` para deletá-los." 147 | }, 148 | "stash push": { 149 | "cmd": "stash push []", 150 | "docs": "Salva as suas modificações locais em uma área temporária (stash) e rode `git reset --hard` para desfazê-las. A é opcional e fornece a descrição do que foi salvo. Para salvar de forma mais rápida, você pode omitir o `push` e ." 151 | }, 152 | "stash apply": { 153 | "cmd": "stash apply []", 154 | "docs": "Traz de volta as modificações da área temporária (stash) para a máquina local (workspace). O padrão é trazer a última modificação salva. A modificação continua salva na área temporária" 155 | }, 156 | "stash pop": { 157 | "cmd": "stash pop", 158 | "docs": "Traz de volta as modificações da área temporária (stash) para a máquina local (workspace). O padrão é trazer a última modificação salva. A modificação é removida da área temporária" 159 | }, 160 | "stash list": { 161 | "cmd": "stash list", 162 | "docs": "Lista as modificações salvas na área temporária (stash)." 163 | }, 164 | "stash show": { 165 | "cmd": "stash show []", 166 | "docs": "Mostra a diferença entre o que está salvo na memória e o estado original. Se nenhum específico for fornecido, mostra o último stash salvo." 167 | }, 168 | "stash drop": { 169 | "cmd": "stash drop []", 170 | "docs": "Remove um stash da área temporária.m the stash list. Se nenhum for fornecido, remove o último stash salvo." 171 | }, 172 | "stash clear": { 173 | "cmd": "stash clear", 174 | "docs": "Remove todas as modificaçẽos armazenadas na área temporária (stash). AVISO: é impossível recuperá-las posteriormente." 175 | }, 176 | "stash branch x": { 177 | "cmd": "stash branch []", 178 | "docs": "Cria e muda para uma branch chamada a partir do commit no qual o foi originalmente criado, aplica as alterações registradas em ao diretório e à fila.\rSe isso for bem-sucedido, e for uma referência do formato stash@{}, ele descartará o . Quando nenhum é fornecido, aplica-se o mais recente. \rIsto é útil se a branch no qual você executou o `git stash push` mudou o suficiente para que o `git stash apply` falhe devido a conflitos. Como o stash é aplicado em cima do commit que era `HEAD` no momento em que o `git stash` foi executado, ele restaura o estado original do stash sem conflitos." 179 | } 180 | }, 181 | "locations": { 182 | "stash": "área temporária (stash)", 183 | "workspace": "máquina local (workspace)", 184 | "index": "fila (index)", 185 | "local_repo": "repositório local", 186 | "remote_repo": "repositório remoto", 187 | "docs": { 188 | "stash": "Um lugar para armazenar modificações de forma temporária enquanto trabalha-se em outra coisa.", 189 | "workspace": "Código ou projeto na sua máquina local.", 190 | "index": "Uma fila de arquivos a serem commitados. Antes de commitar os arquivos, é necessário adicioná-los à fila.", 191 | "local_repo": "Um diretório na máquina local contendo uma pasta `.git` e todos os arquivos de um projeto versionado. BNomes comuns para branches locais: `main`, `master`, `feature-x`, `bugfix-y`.", 192 | "remote_repo": "Um repositório remoto do código ou projeto para compartilhar e colaborar com outros desenvolvedores. Normalmente são servidores remotos como o Github. O nome padrão é `origin`. Nomes comuns para branches remotas: `main`, `master`, `shared-feature-x`, `release-y`. Também chamado de `remote` em inglês." 193 | } 194 | } 195 | } -------------------------------------------------------------------------------- /git-cheatsheet/lang/vi.json: -------------------------------------------------------------------------------- 1 | { 2 | "commands": { 3 | "status": { 4 | "cmd": "status", 5 | "docs": "Hiển thị: \r• đường dẫn tới các tệp có sự thay đổi giữa các tệp trong chỉ mục và commit `HEAD` hiện tại, \r• đường dẫn tới các sự thay đổi giữa không gian làm việc và tệp chỉ mục và \r• đường dẫn tới các tệp trong không gian làm việc mà git chưa theo dõi sự thay đổi." 6 | }, 7 | "diff": { 8 | "cmd": "diff", 9 | "docs": "Hiển thị các sự thay đổi chưa được thêm vào vùng chỉ mục." 10 | }, 11 | "diff x": { 12 | "cmd": "diff ", 13 | "docs": "Hiển thị các sự thay đổi được thực hiện trên không gian làm việc hiện tại so với commit có tên . Bạn có thể sử dụng `HEAD` để so sánh với commit mới nhất, hoặc sử dụng tên nhánh để so sánh với commit mới nhất trong 1 nhánh khác." 14 | }, 15 | "add x": { 16 | "cmd": "add ", 17 | "docs": "Thêm nội dung hiện tại của tệp mới (hoặc tệp đã bị chỉnh sửa) vào vùng chỉ mục, tức là stage phần nội dung đó để thêm vào commit tiếp theo. Sử dụng lệnh `add --interactive` để lần lượt thêm nội dung đã chỉnh sửa từ không gian làm việc vào vùng chỉ mục bằng cách tương tác trực tiếp với cửa sổ lệnh." 18 | }, 19 | "add -u": { 20 | "cmd": "add -u", 21 | "docs": "Thêm các tệp có nội dung được chỉnh sửa (KHÔNG PHẢI TỆP MỚI) vào vùng chỉ mục. Lệnh này tương tự với các việc mà lệnh `git commit -a` thực hiện để chuẩn bị cho việc thực hiện một commit." 22 | }, 23 | "rm x": { 24 | "cmd": "rm <(các) tệp...>", 25 | "docs": "Xoá một tệp khỏi không gian làm việc và vùng chỉ mục." 26 | }, 27 | "mv x": { 28 | "cmd": "mv <(các) tệp...>", 29 | "docs": "Di chuyển một tệp trong không gian làm việc hoặc vùng chỉ mục." 30 | }, 31 | "commit -a": { 32 | "cmd": "commit -a [-m 'msg']", 33 | "docs": "Commit tất cả (all) các tệp đã được chỉnh sửa từ commit gần nhất, trừ các tệp chưa được theo dõi (tức là tất cả các tệp đã được liệt kê trong vùng chỉ mục). Lệnh này cũng xoá các tệp trong vùng chỉ mục mà đã bị xoá khỏi không gian làm việc." 34 | }, 35 | "checkout x": { 36 | "cmd": "checkout <(các) tệp ... hoặc thư mục>", 37 | "docs": "Cập nhật các tệp và thư mục trong không gian làm việc. Lệnh này KHÔNG chuyển nhánh." 38 | }, 39 | "reset head x": { 40 | "cmd": "reset HEAD <(các) tệp...>", 41 | "docs": "Xoá một số tệp nhất định khỏi commit tiếp theo. Lệnh này đặt lại (reset) vùng chỉ mục nhưng không đặt lại cây thư mục làm việc (tức là các tệp bị chỉnh sửa được giữ nguyên nhưng sẽ không được đánh dấu để commit) và hiển thị những gì không được cập nhật." 42 | }, 43 | "reset --soft head^": { 44 | "cmd": "reset --soft HEAD^", 45 | "docs": "Hoàn tác commit gần nhất, giữ nguyên các thay đổi trên vùng chỉ mục." 46 | }, 47 | "reset --hard": { 48 | "cmd": "reset --hard", 49 | "docs": "Khớp không gian làm việc và vùng chỉ mục với cây thư mục làm việc hiện tại. CHÚ Ý: Bất cứ thay đổi nào trên các tệp đang được theo dõi trên cây thư mục so với commit gần nhất sẽ bị hoàn tác. Sử dụng lệnh này khi việc sát nhập (merge) gây ra xung đột và bạn muốn bắt đầu lại từ commit cuối. Truyền vào `ORIG_HEAD` để hoàn tác việc sát nhập mới nhất và tất cả các thay đổi sau đó." 50 | }, 51 | "switch": { 52 | "cmd": "switch ", 53 | "docs": "Chuyển sang một nhánh được chỉ định bằng cách cập nhật vùng chỉ mục và không gian làm việc theo nhánh đó, và cập nhật `HEAD` thành ." 54 | }, 55 | "checkout -b x": { 56 | "cmd": "checkout -b ", 57 | "docs": "Tạo một nhánh mới và chuyển sang nhánh đó." 58 | }, 59 | "merge x": { 60 | "cmd": "merge ", 61 | "docs": "Sát nhập các sự thay đổi từ nhánh hoặc từ 1 commit vào nhánh hiện tại.\rSử dụng `‑‑no-commit` để bỏ qua các sự thay đổi chưa được commit. Sử dụng `--no-ff` để sát nhập commit ngay cả khi việc sát nhập được coi là một \"fast-forward\"." 62 | }, 63 | "rebase x": { 64 | "cmd": "rebase ", 65 | "docs": "Khôi phục tất cả các commit từ thời điểm mà nhánh hiện tại rẽ nhánh khỏi , và thêm từng commit một vào sau `HEAD` của ." 66 | }, 67 | "cherry-pick x": { 68 | "cmd": "cherry-pick ", 69 | "docs": "Kết hợp các sự thay đổi trong commit được chỉ định vào nhánh hiện tại." 70 | }, 71 | "revert x": { 72 | "cmd": "revert ", 73 | "docs": "Hoàn tác commit được chỉ định và commit kết quả quá trình hoàn tác. Lệnh này yêu cầu cây thư mục làm việc phải sạch (không có bất cứ sự thay đổi này so với commit `HEAD`)." 74 | }, 75 | "diff --cached": { 76 | "cmd": "diff --cached []", 77 | "docs": "Hiển thị các sự thay đổi mà bạn đã stage so với commit gần nhất, và CÓ thể truyền vào tên để so sánh các thay đổi so với commit đó." 78 | }, 79 | "commit": { 80 | "cmd": "commit [-m 'msg']", 81 | "docs": "Lưu nội dung của vùng chỉ mục hiện tại thành một commit mới cùng với một thông điệp mô tả các thay đổi trong commit này." 82 | }, 83 | "commit --amend": { 84 | "cmd": "commit --amend", 85 | "docs": "Chỉnh sửa commit mới nhất theo các thay đổi trong vùng chỉ mục hiện tại." 86 | }, 87 | "log": { 88 | "cmd": "log", 89 | "docs": "Hiện thị các commit gần đây, với commit mới nhất được hiện thị đầu tiên. Các tuỳ chọn:\r`‑‑decorate` hiện thị tên nhánh và tên các thẻ trên các commit thích hợp\r`‑‑stat` hiện thị thêm các thông số (các tệp thay đổi, số dòng thêm, và số dòng xoá) \r`‑‑author=` hiện thị các commit bởi một tác giả nhất định\r`‑‑after=\"MMM DD YYYY\"` ví dụ (`Jun 20 2008`) chỉ hiện thị các commit sau một ngày nhất định\r`‑‑before=\"MMM DD YYYY\"` chỉ hiển thị các commit trước một ngày nhất định\r`‑‑merge` chỉ hiện thị các commit liên quan đến các xung đột trong quá trình sát nhập hiện tại" 90 | }, 91 | "diff x x": { 92 | "cmd": "diff ", 93 | "docs": "Hiển thị sự thay đổi giữa 2 commit bất kỳ." 94 | }, 95 | "branch": { 96 | "cmd": "branch", 97 | "docs": "Liệt kê các nhánh hiện có. Tuỳ chọn `-r` sẽ liệt kê các nhánh được theo dõi trên remote, và tuỳ chọn `-a` hiện thị cả hai." 98 | }, 99 | "branch -d x": { 100 | "cmd": "branch -d ", 101 | "docs": "Xoá một nhánh nhất định. Sử dụng `-D` để bắt buộc việc xoá." 102 | }, 103 | "branch --track x x": { 104 | "cmd": "branch --track ", 105 | "docs": "Tạo một nhánh cục bộ mới từ một nhánh đang được theo dõi trên remote." 106 | }, 107 | "clone x": { 108 | "cmd": "clone ", 109 | "docs": "Tải một kho chứa chỉ định bởi đường dẫn về và checkout sang `HEAD` của nhánh main." 110 | }, 111 | "pull x x": { 112 | "cmd": "pull ", 113 | "docs": "Khớp các sự thay đổi trên kho chứa remote vào nhánh hiện tại. Ở dạng mặc định, `git pull` có thể coi là viết tắt của 2 lệnh `git fetch` nối tiếp bởi `git merge FETCH_HEAD`." 114 | }, 115 | "reset --hard x/x": { 116 | "cmd": "reset --hard /", 117 | "docs": "Đặt lại kho chứa cục bộ và cây thư mục để khớp với một nhánh được theo dõi trên remote. Sử dụng `reset ‑‑hard origin/main` để bỏ qua tất cả các commit của nhánh main cục bộ. Hãy sử dụng tuỳ chọn này nếu cần thực hiện lại một quá trình sát nhập lỗi." 118 | }, 119 | "fetch x x": { 120 | "cmd": "fetch ", 121 | "docs": "Tải về các đối tượng và các tham chiếu (refspec) từ một kho chứa khác." 122 | }, 123 | "push": { 124 | "cmd": "push", 125 | "docs": "Cập nhật máy chủ với tất cả các commit trên tất cả các nhánh *CHUNG* giữa bản sao cục bộ của bạn và máy chủ. Các nhánh cục bộ mà chưa từng được đẩy (*push*) lên máy chủ thì sẽ không được chia sẻ." 126 | }, 127 | "push x x": { 128 | "cmd": "push ", 129 | "docs": "Đẩy một nhánh mới (hoặc đã tồn tại) lên kho chứa remote." 130 | }, 131 | "push x x:x": { 132 | "cmd": "push :", 133 | "docs": "Đẩy một nhánh mới lên kho chứa remote với một tên gọi khác." 134 | }, 135 | "branch -r": { 136 | "cmd": "branch -r", 137 | "docs": "Liệt kê các nhánh remote." 138 | }, 139 | "push --delete": { 140 | "cmd": "push --delete ", 141 | "docs": "Xoá một nhánh remote, theo đúng nghĩa đen ký hiệu bởi câu lệnh \"không đẩy bất cứ gì lên nhánh này nữa\"." 142 | }, 143 | "clean": { 144 | "cmd": "clean", 145 | "docs": "Làm sạch cây thư mục làm việc hiện tại bằng cách loại bỏ tất cả các tệp không thuộc trình quản lý phiên bản, bắt đầu từ thư mục hiện tại và đệ quy tới tất cả các thư mục con. Sử dụng `-n` để thực hiện một \"bản chạy nháp\" để xem những gì sẽ bị xoá. Sử dụng `-f` để xoá các tệp." 146 | }, 147 | "stash push": { 148 | "cmd": "stash push []", 149 | "docs": "Lưu các chỉnh sửa cục bộ của bạn vào một stash mới, và chạy `git reset ‑‑hard` để hoàn tác toàn bộ. Tham số là không bắt buộc để mô tả cho stash kèm với trạng thái stash. Để lưu nhanh các thay đổi, bạn có thể bỏ qua cả `push` lẫn ." 150 | }, 151 | "stash apply": { 152 | "cmd": "stash apply []", 153 | "docs": "Đưa các thay đổi trong 1 stash nhất định vào không gian làm việc. Mặc định lệnh này sẽ chọn stash mới nhất." 154 | }, 155 | "stash pop": { 156 | "cmd": "stash pop", 157 | "docs": "Kết hợp các thay đổi trong stash mới nhất (hoặc được chỉ định) và xoá stash đó." 158 | }, 159 | "stash list": { 160 | "cmd": "stash list", 161 | "docs": "Liệt kê các stash mà bạn hiện đang có." 162 | }, 163 | "stash show": { 164 | "cmd": "stash show []", 165 | "docs": "Hiển thị các thay đổi được lưu trong stash như một câu lệnh `diff` giữa trạng thái được stash và trạng thái cha. Khi không chỉ định stash, hiển thị stash mới nhất." 166 | }, 167 | "stash drop": { 168 | "cmd": "stash drop []", 169 | "docs": "Xoá một trạng thái stash khỏi danh sách các stash. Khi không chỉ định stash, xoá stash mới nhất." 170 | }, 171 | "stash clear": { 172 | "cmd": "stash clear", 173 | "docs": "Xoá tất cả các trạng thái stash. Chú ý rằng các trạng thái này đôi khi sẽ không thể khôi phục lại được sau khi xoá." 174 | }, 175 | "stash branch x": { 176 | "cmd": "stash branch []", 177 | "docs": "Tạo và chuyển sang một nhánh mới có tên bắt đầu tại commit mà được tạo trên, và kết hợp các thay đổi trong vào cây thư mục làm việc và vùng chỉ mục mới. \rNếu thành công, và là một tham chiếu theo dạng stash@{}, thì stash đó bị xoá. Khi không chỉ định , sử dụng stash mới nhất. \rLệnh này sẽ giúp ích nếu nhánh mà bạn đã chạy `git stash push` thay đổi quá nhiều khiến cho `git stash apply` thất bại do xung đột. Do stash được kết hợp với commit mà là `HEAD` tại thời điểm `git stash` được chạy, nó sẽ khôi phục lại trạng thái stash ban đầu và không có xung đột nào." 178 | } 179 | }, 180 | "locations": { 181 | "stash": "vùng stash", 182 | "workspace": "không gian làm việc", 183 | "index": "vùng chỉ mục", 184 | "local_repo": "kho chứa cục bộ", 185 | "remote_repo": "kho chứa remote", 186 | "docs": { 187 | "stash": "Nơi lưu trữ, cất giấu những chỉnh sửa chưa hoàn thiện khi bạn đang thực hiện một công việc khác.", 188 | "workspace": "Không gian làm việc cục bộ của người dùng.", 189 | "index": "Nơi chứa các tệp bạn muốn commit. Trước khi thực hiện \"commit\" các thay đổi, bạn cần thêm chúng vào vùng chỉ mục. Vùng này cũng có thể được gọi là \"vùng staging\", \"cache\", hay các \"tệp staged\".", 190 | "local_repo": "Gồm có thư mục con có tên `.git` chứa tất cả các tệp cần thiết của kho chứa — một bộ khung cho kho chứa Git. Các nhánh thường có tên: `main`, `feature-x`, `bugfix-y`", 191 | "remote_repo": "Các phiên bản của dự án được lưu trữ trên mạng Internet, giúp đảm bảo rằng tất cả các cập nhật của bạn có thể được truy cập bởi các nhà phát triển khác. Tên mặc định của kho chứa này là `origin`. Các nhánh thường có tên: `main`, `shared-feature-x`, `release-y`" 192 | } 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "dir": "ltr", 3 | "author": "Andrew J. Peterson, NDP Software", 4 | "commands": { 5 | "status": { 6 | "cmd": "status", 7 | "docs": "Displays: \r• paths that have differences between the index file and the current `HEAD` commit, \r• paths that have differences between the workspace and the index file, and \r• paths in the workspace that are not tracked by git." 8 | }, 9 | "diff": { 10 | "cmd": "diff", 11 | "docs": "Displays the differences not added to the index." 12 | }, 13 | "diff x": { 14 | "cmd": "diff ", 15 | "docs": "View the changes you have in your workspace relative to the named . You can use `HEAD` to compare it with the latest commit, or a branch name to compare with the tip of a different branch" 16 | }, 17 | "add x": { 18 | "cmd": "add ", 19 | "docs": "Adds the current content of new or modified files to the index, thus staging that content for inclusion in the next commit. Use `add --interactive` to add the modified contents in the workspace interactively to the index." 20 | }, 21 | "add -u": { 22 | "cmd": "add -u", 23 | "docs": "Adds the current content of modified (NOT NEW) files to the index. This is similar to what `git commit -a` does in preparation for making a commit." 24 | }, 25 | "rm x": { 26 | "cmd": "rm ", 27 | "docs": "Remove a file from the workspace and the index." 28 | }, 29 | "mv x": { 30 | "cmd": "mv ", 31 | "docs": "Move file in the workspace and the index." 32 | }, 33 | "commit -a": { 34 | "cmd": "commit -a [-m 'msg']", 35 | "docs": "Commit all files changed since your last commit, except untracked files (i.e. all files that are already listed in the index). Remove files in the index that have been removed from the workspace." 36 | }, 37 | "checkout x": { 38 | "cmd": "checkout ", 39 | "docs": "Updates the file or directory in the workspace. Does NOT switch branches." 40 | }, 41 | "reset head x": { 42 | "cmd": "reset HEAD ", 43 | "docs": "Remove the specified files from the next commit. Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated." 44 | }, 45 | "reset --soft head^": { 46 | "cmd": "reset --soft HEAD^", 47 | "docs": "Undo the last commit, leaving its changes in the workspace, uncommitted. Does not touch the index file or the working tree at all. The only change it makes is to the head of the local repository." 48 | }, 49 | "reset --hard": { 50 | "cmd": "reset --hard", 51 | "docs": "Matches the workspace and index to the local tree. WARNING: Any changes to tracked files in the working tree since commit are lost. Use this if merging has resulted in conflicts and you'd like to start over. Pass `ORIG_HEAD` to undo the most recent successful merge and any changes after." 52 | }, 53 | "switch": { 54 | "cmd": "switch ", 55 | "docs": "Switches branches by updating the index and workspace to reflect the specified branch, , and updating `HEAD` to be ." 56 | }, 57 | "checkout -b x": { 58 | "cmd": "checkout -b ", 59 | "docs": "Create a branch and switch to it" 60 | }, 61 | "merge x": { 62 | "cmd": "merge ", 63 | "docs": "Merge changes from into current branch.\rUse `‑‑no-commit` to leave changes uncommitted. Use `--no-ff` to create a merge commit even if the merge resolves as a fast forward." 64 | }, 65 | "rebase x": { 66 | "cmd": "rebase ", 67 | "docs": "Reverts all commits since the current branch diverged from , and then re-applies them one-by-one on top of changes from the `HEAD` of ." 68 | }, 69 | "cherry-pick x": { 70 | "cmd": "cherry-pick ", 71 | "docs": "Integrate changes in the given commit into the current branch." 72 | }, 73 | "revert x": { 74 | "cmd": "revert ", 75 | "docs": "Reverse commit specified by and commit the result. This requires your working tree to be clean (no modifications from the `HEAD` commit)." 76 | }, 77 | "diff --cached": { 78 | "cmd": "diff --cached []", 79 | "docs": "View the changes you staged vs the latest commit. Can pass a to see changes relative to it." 80 | }, 81 | "commit": { 82 | "cmd": "commit [-m 'msg']", 83 | "docs": "Stores the current contents of the index in a new commit along with a log message from the user describing the changes." 84 | }, 85 | "commit --amend": { 86 | "cmd": "commit --amend", 87 | "docs": "Modify the last commit with the current index changes." 88 | }, 89 | "log": { 90 | "cmd": "log", 91 | "docs": "Show recent commits, most recent on top. Options:\r`‑‑decorate` with branch and tag names on appropriate commits\r`‑‑stat` with stats (files changed, insertions, and deletions) \r`‑‑author=` only by a certain author\r`‑‑after=\"MMM DD YYYY\"` ex. (`Jun 20 2008`) only commits after a certain date\r`‑‑before=\"MMM DD YYYY\"` only commits that occur before a certain date \r`‑‑merge` only the commits involved in the current merge conflicts" 92 | }, 93 | "diff x x": { 94 | "cmd": "diff ", 95 | "docs": "View the changes between two arbitrary commits" 96 | }, 97 | "branch": { 98 | "cmd": "branch", 99 | "docs": "List all existing branches. Option `-r` causes the remote-tracking branches to be listed, and option `-a` shows both." 100 | }, 101 | "branch -d x": { 102 | "cmd": "branch -d ", 103 | "docs": "Delete an specified branch. Use `-D` to force." 104 | }, 105 | "branch --track x x": { 106 | "cmd": "branch --track /", 107 | "docs": "Create a new local branch from a remote-tracking branch." 108 | }, 109 | "clone x": { 110 | "cmd": "clone ", 111 | "docs": "Download the repository specified by and checkout `HEAD` of the main branch." 112 | }, 113 | "pull x x": { 114 | "cmd": "pull ", 115 | "docs": "Incorporates changes from a remote repository into the current branch. In its default mode, `git pull` is shorthand for `git fetch` followed by `git merge FETCH_HEAD`." 116 | }, 117 | "reset --hard x/x": { 118 | "cmd": "reset --hard /", 119 | "docs": "Reset local repo and working tree to match a remote-tracking branch. Use `reset ‑‑hard origin/main` to throw away all commits to the local main branch. Use this to start over on a failed merge." 120 | }, 121 | "fetch x x": { 122 | "cmd": "fetch ", 123 | "docs": "Download objects and refs from another repository." 124 | }, 125 | "push": { 126 | "cmd": "push", 127 | "docs": "Update the server with your commits to the current branch. `--all` transfers the commits of all branches." 128 | }, 129 | "push x x": { 130 | "cmd": "push ", 131 | "docs": "Push new (or existing) branch to remote repository" 132 | }, 133 | "push x x:x": { 134 | "cmd": "push :", 135 | "docs": "Push a branch to remote repository with a different name. is the local branch name, and is the branch name in the remote repository." 136 | }, 137 | "branch -r": { 138 | "cmd": "branch -r", 139 | "docs": "List remote branches" 140 | }, 141 | "push --delete": { 142 | "cmd": "push --delete ", 143 | "docs": "Remove a remote branch." 144 | }, 145 | "clean": { 146 | "cmd": "clean", 147 | "docs": "Cleans the working tree by recursively removing files that are not under version control, starting from the current directory. Use `-n` for a \"dry run\" to see what would be deleted. Use `-f` to delete the files." 148 | }, 149 | "stash push": { 150 | "cmd": "stash push []", 151 | "docs": "Save your local modifications to a new stash, and run `git reset ‑‑hard` to revert them. The part is optional and gives the description along with the stashed state. For quickly making a snapshot, you can omit both `push` and ." 152 | }, 153 | "stash apply": { 154 | "cmd": "stash apply []", 155 | "docs": "Move changes from the specified stash into the workspace. The latest stash is the default." 156 | }, 157 | "stash pop": { 158 | "cmd": "stash pop", 159 | "docs": "Applies the changes from the last (or specified) stash and then removes the given stash." 160 | }, 161 | "stash list": { 162 | "cmd": "stash list", 163 | "docs": "List the stashes that you currently have." 164 | }, 165 | "stash show": { 166 | "cmd": "stash show []", 167 | "docs": "Show the changes recorded in the stash as a diff between the stashed state and its original parent. When no is given, shows the latest one." 168 | }, 169 | "stash drop": { 170 | "cmd": "stash drop []", 171 | "docs": "Remove a single stashed state from the stash list. When no is given, it removes the latest one." 172 | }, 173 | "stash clear": { 174 | "cmd": "stash clear", 175 | "docs": "Remove all the stashed states. Note that those states will then be subject to pruning, and may be impossible to recover." 176 | }, 177 | "stash branch x": { 178 | "cmd": "stash branch []", 179 | "docs": "Creates and checks out a new branch named starting from the commit at which the was originally created, applies the changes recorded in to the new working tree and index. \rIf that succeeds, and is a reference of the form stash@{}, it then drops the . When no is given, applies the latest one. \rThis is useful if the branch on which you ran `git stash push` has changed enough that `git stash apply` fails due to conflicts. Since the stash is applied on top of the commit that was `HEAD` at the time `git stash` was run, it restores the originally stashed state with no conflicts." 180 | } 181 | }, 182 | "locations": { 183 | "stash": "stash", 184 | "workspace": "workspace", 185 | "index": "index", 186 | "local_repo": "local repository", 187 | "remote_repo": "upstream repository", 188 | "docs": { 189 | "stash": "A place to hide modifications while you work on something else.", 190 | "workspace": "Local checkout of your code. Also called 'working copy', 'working tree' or just 'checkout'. It's any directory on your filesystem that has a repository associated with it (typically indicated by the presence of a sub-directory within it named `.git`). It includes all the files and sub-directories in that directory.", 191 | "index": "A staging area for file changes to commit. Before you “commit” (or checkin) files, you need to first add them to the index. This is also called \"current directory cache\", \"staging area\", \"cache\" or \"staged files\".", 192 | "local_repo": "A directory named `.git` that contains all of your necessary repository files — a Git repository skeleton. Typical branches: `main`, `master`, `feature-x`, `bugfix-y`. The local repository has exactly the same features and functionality as any other Git repository.", 193 | "remote_repo": "A repository of your code to share and collaborate with other developers. It's hosted on some the Internet or a remote, eg. Github. The default name is `origin`. Typical branches here: `main`, `master`, `shared-feature-x`, `release-y`. Also called 'remote repository', or just 'remote'." 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /git-cheatsheet/lang/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "dir": "ltr", 3 | "author": "Vitaliy Star", 4 | "commands": { 5 | "status": { 6 | "cmd": "status", 7 | "docs": "Отобразить: \r• пути, которые имеют различия между индексным файлом и текущим коммитом `HEAD`, \r• пути, которые имеют различия между рабочей областью и индексным файлом, и \r• пути в рабочей области, которые не отслеживаются git." 8 | }, 9 | "diff": { 10 | "cmd": "diff", 11 | "docs": "Отобразить различия, не добавленные в индекс." 12 | }, 13 | "diff x": { 14 | "cmd": "diff <коммит или ветка>", 15 | "docs": "Просмотреть изменения, которые есть в вашей рабочей области относительно именованного <коммита>. Вы можете использовать HEAD, чтобы сравнить его с последним коммитом, или имя ветки, чтобы сравнить его с концом другой ветки." 16 | }, 17 | "add x": { 18 | "cmd": "add <файл... или каталог...>", 19 | "docs": "Добавить текущее содержимое новых или изменённых файлов в индекс, тем самым подготавливая это содержимое для включения в следующий коммит. Используйте `add --interactive`, чтобы интерактивно добавить изменённое содержимое рабочей области в индекс." 20 | }, 21 | "add -u": { 22 | "cmd": "add -u", 23 | "docs": "Добавить в индекс текущее содержимое изменённых (НЕ НОВЫХ) файлов. Это похоже на то, что делает git commit -a при подготовке к коммиту." 24 | }, 25 | "rm x": { 26 | "cmd": "rm <файл(ы)...>", 27 | "docs": "Удалить файл(ы) из рабочей области и индекса." 28 | }, 29 | "mv x": { 30 | "cmd": "mv <файл(ы)...>", 31 | "docs": "Переместить файл(ы) в рабочую область и в индекс." 32 | }, 33 | "commit -a": { 34 | "cmd": "commit -a [-m 'сообщение']", 35 | "docs": "Закоммитить все файлы, изменённые с момента последнего коммита, за исключением неотслеживаемых файлов (т.е. всех файлов, которые уже указаны в индексе). Удаляет файлы в индексе, которые были удалены из рабочей области." 36 | }, 37 | "checkout x": { 38 | "cmd": "checkout <файл(ы)... или каталог>", 39 | "docs": "Обновить файл или каталог в рабочей области. НЕ переключает ветки." 40 | }, 41 | "reset head x": { 42 | "cmd": "reset HEAD <файл(ы)...>", 43 | "docs": "Удалить указанные файлы из следующего коммита. Сбрасывает индекс, но не рабочее дерево (т. е. измененные файлы сохраняются, но не помечаются для фиксации) и сообщает, что не было обновлено." 44 | }, 45 | "reset --soft head^": { 46 | "cmd": "reset --soft HEAD^", 47 | "docs": "Отменить последний коммит, оставив его изменения в рабочей области незафиксированными. Не затрагивает индексный файл или рабочее дерево. Единственное изменение, которое он вносит, — это заголовок локального репозитория." 48 | }, 49 | "reset --hard": { 50 | "cmd": "reset --hard", 51 | "docs": "Сопоставить рабочую область и индекс с локальным деревом. ВНИМАНИЕ: Любые изменения в отслеживаемых файлах в рабочем дереве с момента фиксации теряются. Используйте это, если слияние привело к конфликтам и вы хотите начать все сначала. Укажите `ORIG_HEAD`, чтобы отменить последнее успешное слияние и любые последующие изменения." 52 | }, 53 | "switch": { 54 | "cmd": "switch <ветка>", 55 | "docs": "Переключить ветку, обновляя индекс и рабочую область, чтобы они отражали указанную <ветку>, и обновляя `HEAD` до <ветки>." 56 | }, 57 | "checkout -b x": { 58 | "cmd": "checkout -b <название новой ветки>", 59 | "docs": "Создать ветку и переключить на неё." 60 | }, 61 | "merge x": { 62 | "cmd": "merge <коммит или ветку>", 63 | "docs": "Объединить изменения из <имя ветки> в текущую ветку.\rИспользуйте `‑‑no-commit`, чтобы оставить изменения незакоммиченными. Используйте `--no-ff` для создания коммита слияния, даже если слияние разрешается как ускоренная перемотка вперед." 64 | }, 65 | "rebase x": { 66 | "cmd": "rebase <восходящая ветка>", 67 | "docs": "Отменить все коммиты с тех пор, как текущая ветка отклонилась от <восходящей ветки>, а затем повторно применить их один за другим поверх изменений из `HEAD` <восходящей ветки>." 68 | }, 69 | "cherry-pick x": { 70 | "cmd": "cherry-pick <коммит>", 71 | "docs": "Интегрировать изменения указанного коммита в текущую ветку." 72 | }, 73 | "revert x": { 74 | "cmd": "revert <коммит>", 75 | "docs": "Отменить указанный <коммит>, и закоммитить результат. Для этого необходимо, чтобы ваше рабочее дерево было чистым (без изменений после коммита `HEAD`)." 76 | }, 77 | "diff --cached": { 78 | "cmd": "diff --cached [<коммит>]", 79 | "docs": "Просмотр изменений, которые вы внесли, по сравнению с последним коммитом. Можно передать <коммит>, чтобы увидеть изменения относительно него." 80 | }, 81 | "commit": { 82 | "cmd": "commit [-m 'сообщение']", 83 | "docs": "Сохранить текущее содержимое индекса в новом коммите вместе с сообщением от пользователя, описывающим изменения." 84 | }, 85 | "commit --amend": { 86 | "cmd": "commit --amend", 87 | "docs": "Изменить последний коммит с учётом текущих изменений индекса." 88 | }, 89 | "log": { 90 | "cmd": "log", 91 | "docs": "Отобразить последние коммиты, самые последние вверху. Опции:\r`‑‑decorate` с именами веток и тегов на соответствующих коммитах\r`‑‑stat` со статистикой (изменения файлов, вставки и удаления) \r`‑‑author=<автор>` только определённого автора\r`‑‑after=\"МММ ДД ГГГГ\"` напр. (`Jun 20 2008`) только коммиты после определённой даты\r`‑-before=\"МММ ДД ГГГГ\"` только коммиты до определённой даты \r`‑‑merge` только те коммиты, которые включены в текущее объединение конфликтов." 92 | }, 93 | "diff x x": { 94 | "cmd": "diff <коммит> <коммит>", 95 | "docs": "Отобразить изменений между двумя произвольными коммитами" 96 | }, 97 | "branch": { 98 | "cmd": "branch", 99 | "docs": "Вывести все существующие ветки. Опция `-r` приводит к отображению веток удалённого репозитория, а опция `-a` показывает оба репозитория." 100 | }, 101 | "branch -d x": { 102 | "cmd": "branch -d <ветка>", 103 | "docs": "Удалить указанную ветку. Укажите `-D` для принудительного выполнения." 104 | }, 105 | "branch --track x x": { 106 | "cmd": "branch --track <название новой ветки> <удалённый репозиторий>/<ветка>", 107 | "docs": "Создать новую локальную ветку из ветки удалённого репозитория." 108 | }, 109 | "clone x": { 110 | "cmd": "clone <репозиторий>", 111 | "docs": "Загрузить указанный <репозиторий>, и извлечь `HEAD` основной ветки." 112 | }, 113 | "pull x x": { 114 | "cmd": "pull <удалённый репозиторий> <спецификация ссылки>", 115 | "docs": "Включить изменения из удалённого репозитория в текущую ветку. В режиме по умолчанию `git pull` является сокращением от `git fetch`, за которым следует `git merge FETCH_HEAD`." 116 | }, 117 | "reset --hard x/x": { 118 | "cmd": "reset --hard <удалённый репозиторий>/<ветка>", 119 | "docs": "Сбросить локальный репозиторий и рабочее дерево, чтобы оно соответствовало ветке удалённого отслеживания. Используйте `reset ‑-hard origin/main`, чтобы отменить все коммиты в локальной основной ветке. Используйте это, чтобы начать заново в случае неудачного слияния." 120 | }, 121 | "fetch x x": { 122 | "cmd": "fetch <удалённый репозиторий> <спецификация ссылки>", 123 | "docs": "Скачать объекты и ссылки из другого репозитория." 124 | }, 125 | "push": { 126 | "cmd": "push", 127 | "docs": "Обновить сервер своими коммитами во всех ветках, которые являются *ОБЩИМИ* между вашей локальной копией и сервером. Локальные ветки, которые никогда не были отправлены на сервер, не являются общими." 128 | }, 129 | "push x x": { 130 | "cmd": "push <удалённый репозиторий> <ветка>", 131 | "docs": "Отправить новую (или существующую) ветку в удалённый репозиторий." 132 | }, 133 | "push x x:x": { 134 | "cmd": "push <удалённый репозиторий> <локальная ветка>:<имя>", 135 | "docs": "Отправить ветку в удалённый репозиторий с другим именем. <локальная ветка> — это имя локальной ветки, а <имя> — это имя ветки в удалённом репозитории." 136 | }, 137 | "branch -r": { 138 | "cmd": "branch -r", 139 | "docs": "Вывести список удалённых веток" 140 | }, 141 | "push --delete": { 142 | "cmd": "push <удалённый репозиторий> --delete <ветка>", 143 | "docs": "Удалить удалённую ветку." 144 | }, 145 | "clean": { 146 | "cmd": "clean", 147 | "docs": "Очистить рабочее дерево, рекурсивно удаляя файлы, не находящиеся под контролем версий, начиная с текущего каталога. Используйте `-n` для «пробного прогона», чтобы увидеть, что будет удалено. Используйте `-f` для удаления файлов." 148 | }, 149 | "stash push": { 150 | "cmd": "stash push [<сообщение>]", 151 | "docs": "Сохранить локальные изменения в новом тайнике и выполнить «git reset‑‑hard», чтобы отменить их. <сообщение> является необязательнвм и содержит описание к спрятанному состоянию. Чтобы быстро сделать снимок, вы можете опустить `push` и <сообщение>." 152 | }, 153 | "stash apply": { 154 | "cmd": "stash apply [<тайник>]", 155 | "docs": "Переместить изменения из указанного тайника в рабочую область. Последний тайник используется по умолчанию." 156 | }, 157 | "stash pop": { 158 | "cmd": "stash pop", 159 | "docs": "Применяет изменения из последнего (или указанного) тайника, а затем удаляет данный тайник." 160 | }, 161 | "stash list": { 162 | "cmd": "stash list", 163 | "docs": "Вывести тайники, которые у вас есть на данный момент." 164 | }, 165 | "stash show": { 166 | "cmd": "stash show [<тайник>]", 167 | "docs": "Показать изменения, записанные в тайнике, как разницу между спрятанным состоянием и его исходным родительским состоянием. Если не указан, отображается последний." 168 | }, 169 | "stash drop": { 170 | "cmd": "stash drop [<тайник>]", 171 | "docs": "Удалить одно спрятанное состояние из списка спрятанного. Если <тайник> не указан, удаляется последний." 172 | }, 173 | "stash clear": { 174 | "cmd": "stash clear", 175 | "docs": "Удалить все спрятанные состояния. Обратите внимание, что эти состояния затем будут подвергнуты очистке, и их будет невозможно восстановить." 176 | }, 177 | "stash branch x": { 178 | "cmd": "stash branch <имя ветки> [<тайник>]", 179 | "docs": "Создать и извлечь новую ветку с именем <имя ветки>, начиная с коммита, в котором изначально был создан <тайник>, применяет изменения, записанные в <тайник>, к новому рабочему дереву и индексу. \rЕсли это удалось и <тайник> является ссылкой в ​​форме stash@{<ревизия>}, <тайник> удаляется. Если <тайник> не указан, применяется последний. \rЭто полезно, если ветка, в которой вы запустили `git stash push`, изменилась настолько, что `git stash apply` не работает из-за конфликтов. Поскольку кэш применяется поверх коммита, который был `HEAD` на момент запуска git stash, он восстанавливает исходное спрятанное состояние без конфликтов." 180 | } 181 | }, 182 | "locations": { 183 | "stash": "тайник", 184 | "workspace": "рабочее пространство", 185 | "index": "индекс", 186 | "local_repo": "локальный репозиторий", 187 | "remote_repo": "вышестоящий (удалённый) репозиторий", 188 | "docs": { 189 | "stash": "Место, где можно спрятать изменения, пока вы работаете над чем-то другим.", 190 | "workspace": "Локальная копия вашего кода. Также называется «рабочей копией», «рабочим деревом» или просто «копия». Это любой каталог в вашей файловой системе, с которым связан репозиторий (обычно на это указывает наличие в нем подкаталога с именем `.git`). Он включает в себя все файлы и подкаталоги в этом каталоге.", 191 | "index": "Промежуточная область для фиксации изменений файла. Прежде чем «закоммитить» (или вернуть) файлы, вам необходимо сначала добавить их в индекс. Это также называется «кешем текущего каталога», «промежуточной областью», «кэшем» или «проиндексированными файлами».", 192 | "local_repo": "Каталог с именем `.git`, содержащий все необходимые файлы репозитория — скелет репозитория Git. Типичные ветки: `main`, `master`, `feature-x`, `bugfix-y`. Локальный репозиторий имеет те же функции и возможности, что и любой другой репозиторий Git.", 193 | "remote_repo": "Репозиторий вашего кода, которым можно делиться и работать совместно с другими разработчиками. Он размещён в Интернете или на удалённом компьютере, например github. Имя по умолчанию — «origin». Типичные ветки здесь: `main`, `master`, `shared-feature-x`, `release-y`. Также называется «удаленным репозиторием» или просто «удалённым»." 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /src/build-styles.js: -------------------------------------------------------------------------------- 1 | var window=global 2 | 3 | const Csster = require('./lib/csster') 4 | Csster.colorizeString() 5 | const boxShadow = Csster.macros.boxShadow 6 | 7 | const colors = { 8 | stash: '#bf3030', 9 | workspace: '#ff4040'.saturate(-15), 10 | index: '#ff9640', 11 | local_repo: '#cd0074', 12 | remote_repo: '#bf3030', 13 | } 14 | 15 | 16 | const upColor = colors.workspace.darken(10).saturate(-30) 17 | const dnColor = colors.workspace.darken(0).saturate(-30) 18 | const statusColor = '#846C6C' 19 | const monospaced = '"Source Code Pro", monospaced' 20 | const bodyFont = 'Merriweather, sanserif' // 300, 400, 700, 900 21 | 22 | const css = { 23 | 'html,body': { 24 | margin: 0, 25 | padding: 0, 26 | background: 'url(images/vCanvas.jpg)', 27 | boxSizing: 'border-box' 28 | }, 29 | 'a,a:link,a:visited': { 30 | color: colors.local_repo, 31 | textDecoration: 'none', 32 | }, 33 | 'a:hover': { 34 | color: colors.local_repo.darken(10), 35 | textDecoration: 'underline', 36 | }, 37 | 'em:before': { 38 | opacity: .6, 39 | content: '"‹"', 40 | margin: '0 -2px', 41 | }, 42 | 'em:after': { 43 | opacity: .6, 44 | content: '"›"', 45 | margin: '0 -2px', 46 | }, 47 | 'span.optional:before': { 48 | opacity: .6, 49 | content: '"["', 50 | margin: '0 -2px', 51 | }, 52 | 'span.optional:after': { 53 | opacity: .6, 54 | content: '"]"', 55 | margin: '0 -2px', 56 | }, 57 | '#hd': { 58 | '*': { 59 | margin: 0, 60 | padding: 0, 61 | }, 62 | h1: { 63 | font: '50px ImpactLabelRegular, ImpactLabelReversedRegular, verdana', 64 | }, 65 | h2: { 66 | textAlign: 'end', 67 | position: 'absolute', 68 | right: '0', 69 | top: 44, 70 | color: colors.local_repo, 71 | backgroundColor: colors.remote_repo.saturate(-25).lighten(30), 72 | font: 'normal 21px ImpactLabelReversedRegular,ImpactLabelRegular, verdana', 73 | }, 74 | ul: { 75 | marginTop: 2, 76 | marginBottom: -10, 77 | li: { 78 | font: '16px/20px ' + monospaced, 79 | display: 'block', 80 | textAlign: 'end', 81 | color: colors.local_repo.lighten(10).saturate(-40), 82 | }, 83 | }, 84 | h6: { 85 | textAlign: 'end', 86 | color: colors.local_repo.saturate(-60).lighten(10), 87 | position: 'fixed', 88 | bottom: 3, 89 | right: 3, 90 | font: '300 12px ' + bodyFont, 91 | zIndex: 1, 92 | }, 93 | 'h4': { 94 | marginTop: 5, 95 | marginBottom: -15, 96 | }, 97 | '.lang': { 98 | cursor: 'pointer', 99 | backgroundColor: '#e9bebe'.darken(10), 100 | color: '#b3a2a2'.lighten(25), 101 | border: '1px solid transparent', 102 | padding: '1px 2px', 103 | font: '12px ' + monospaced, 104 | '&.selected': { 105 | backgroundColor: '#e9bebe'.darken(20), 106 | color: '#fff', 107 | '&:hover': { 108 | textDecoration: 'none', 109 | }, 110 | }, 111 | '&:hover': { 112 | color: '#fff', 113 | }, 114 | }, 115 | }, 116 | '#diagram': { 117 | marginTop: 20, 118 | position: 'relative', 119 | height: 'calc(100vh - 120px)', 120 | minHeight: '6.8in', 121 | marginBottom: '2cm', 122 | padding: '1px 0', 123 | }, 124 | '.loc': { 125 | position: 'relative', 126 | height: '100%', 127 | cursor: 'pointer', 128 | transitionDuration: '.15s', 129 | transitionProperty: 'color, background-color, opacity', 130 | transitionDelay: '0s', 131 | opacity: .7, 132 | has: boxShadow([3, 3], 2, '#ccc'), 133 | '.bar': { 134 | position: 'absolute', 135 | left: '45%', 136 | top: '0.9in', 137 | bottom: '0.1in', 138 | border: '1px dashed white', 139 | 'border-top': 'none', 140 | width: 10, 141 | }, 142 | 'h5': { 143 | position: 'absolute', 144 | top: 0, 145 | margin: 0, 146 | width: '100%', 147 | 'text-align': 'center', 148 | padding: '11px 0 20px 0', 149 | font: '30px ImpactLabelReversedRegular, ImpactLabelRegular, verdana', 150 | color: '#333', 151 | }, 152 | 'p': { 153 | bottom: 0, 154 | position: 'absolute', 155 | padding: '0 20px', 156 | font: '400 15px ' + bodyFont, 157 | color: 'white', 158 | visibility: 'hidden', 159 | }, 160 | '&.hovered': { 161 | has: boxShadow([2, 2], 6, '#999'), 162 | }, 163 | '&.current': { 164 | has: boxShadow([4, 4], 6, '#555'), 165 | transitionDuration: '.2s', 166 | transitionDelay: '.2s', 167 | p: { 168 | visibility: 'visible', 169 | }, 170 | 'h5': { 171 | color: 'white', 172 | }, 173 | }, 174 | 175 | }, 176 | '#commands': { 177 | position: 'absolute', 178 | top: 85, 179 | left: 0, 180 | width: '100%', 181 | font: '400 15px ' + monospaced, 182 | height: 0, 183 | margin: 0, 184 | padding: 0, 185 | '> dd': { 186 | display: 'none', 187 | }, 188 | '> dt': { 189 | transitionDuration: '.3s', 190 | transitionProperty: 'left, width, opacity, color, background-color', 191 | transitionDelay: '.3s', 192 | color: '#dddddd', 193 | marginBottom: 3, 194 | padding: '1px 5px 4px 5px', 195 | lineHeight: 13, 196 | opacity: 0.3, 197 | visibility: 'hidden', 198 | position: 'absolute', 199 | cursor: 'pointer', 200 | '&.selected': { 201 | has: boxShadow([2, 2], 4, '#00000040'), 202 | fontWeight: '700', 203 | opacity: 0.8, 204 | }, 205 | '> .arrow': { 206 | width: 0, 207 | height: 0, 208 | border: '9px solid transparent', 209 | position: 'absolute', 210 | }, 211 | '&.up': { 212 | color: upColor.lighten(50), 213 | '> .arrow': { 214 | right: '-18px', 215 | top: 0, 216 | }, 217 | }, 218 | '&.dn': { 219 | color: dnColor.lighten(50), 220 | '> .arrow': { 221 | left: '-18px', 222 | top: 0, 223 | }, 224 | }, 225 | '&.status': { 226 | 'border-color': statusColor.lighten(20), 227 | 'background-color': statusColor, 228 | color: statusColor.lighten(50), 229 | '&.selected': { 230 | 'background-color': statusColor.darken(5), 231 | }, 232 | }, 233 | }, 234 | }, 235 | // TBD Not sure how this actually works, so I'm asking 236 | 'body[dir=rtl]': { 237 | '#commands': { 238 | '> dt': { 239 | '&.up': { 240 | color: upColor.lighten(50), 241 | '> .arrow': { 242 | right: 'auto', 243 | left: '-18px', 244 | }, 245 | }, 246 | '&.dn': { 247 | color: dnColor.lighten(50), 248 | '> .arrow': { 249 | left: 'auto', 250 | right: '-18px', 251 | }, 252 | }, 253 | }, 254 | }, 255 | '#commands > dt, #info .cmd': { 256 | direction: 'ltr', 257 | textAlign: 'right', 258 | }, 259 | '#hd h2': { 260 | right: 'auto', 261 | left: 0, 262 | }, 263 | }, 264 | '#info': { 265 | position: 'fixed', 266 | bottom: 0, 267 | left: 0, 268 | width: '100%', 269 | padding: '10px 0 20px 0', 270 | zIndex: 1, 271 | '.screen': { 272 | zIndex: -1, 273 | position: 'absolute', 274 | left: -20, 275 | top: 0, 276 | height: '100%', 277 | width: '150%', 278 | // backgroundImage: 'linear-gradient(90deg, rgba(246, 235, 217, 0) 5%, rgba(246, 235, 217, 1) 10%, rgba(246, 235, 217, 1) 70%, rgba(246, 235, 217, 0) 70%)', 279 | backgroundImage: 'radial-gradient(circle at 40%, rgba(246, 235, 217, 0.97) 85%,rgba(246, 235, 217, 0))', 280 | opacity: 1, 281 | }, 282 | '.cmd,.doc': { 283 | minHeight: '2em', 284 | marginLeft: 20, 285 | }, 286 | '.cmd': { 287 | font: '500 16px/22px ' + monospaced, 288 | marginRight: 20, 289 | marginTop: -2, 290 | width: '100%', 291 | color: 'black', 292 | textAlign: 'start', 293 | lineHeight: 24, 294 | '> span': { 295 | padding: '3px 10px 3px 0', 296 | fontWeight: 'bold', 297 | display: 'inline-block', 298 | }, 299 | '> span:after': { 300 | maxWidth: '70ex', 301 | width: '100vh', 302 | background: `linear-gradient(to right, ${colors.stash}, ${colors.workspace}, ${colors.index}, ${colors.local_repo}, ${colors.remote_repo}, ${colors.remote_repo}00)`, 303 | height: '0.5px', 304 | content: '""', 305 | display: 'block', 306 | marginTop: 5, 307 | } 308 | }, 309 | '.doc': { 310 | font: '300 15px/22px ' + bodyFont, 311 | width: 'calc(100% - 40px)', 312 | maxWidth: '70ex', 313 | marginLeft: 20, 314 | marginRight: 20, 315 | color: 'black', 316 | 'em,b,code': { 317 | font: '400 16px/22px ' + monospaced, 318 | }, 319 | }, 320 | 321 | 322 | }, 323 | }; 324 | 325 | ['stash', 'workspace', 'index', 'local_repo', 'remote_repo'].forEach(function (valueLeft, index) { 326 | var c = colors[valueLeft].saturate(-10) 327 | 328 | css['#' + valueLeft] = { 329 | border: '1px dotted transparent',// + colors[value], 330 | color: colors[valueLeft], 331 | backgroundColor: colors[valueLeft].saturate(-50).lighten(20), 332 | } 333 | css['#' + valueLeft + ' .bar'] = { borderColor: colors[valueLeft].darken(20) } 334 | css['body.' + valueLeft + ' #' + valueLeft] = { 335 | color: 'white', 336 | backgroundColor: colors[valueLeft], 337 | } 338 | css['body.' + valueLeft + ' #commands > dt.' + valueLeft] = { 339 | position: 'relative', 340 | visibility: 'visible', 341 | opacity: 0.9, 342 | '&.selected': { 343 | opacity: 1.0, 344 | }, 345 | } 346 | 347 | const colorLeft = colors[valueLeft].saturate(-10).darken(10) 348 | const colorLeftSelected = colorLeft.darken(10) 349 | 350 | css[`body[dir=ltr] #commands > dt.up.right-${valueLeft} > .arrow`] = { 351 | 'border-left-color': colorLeft, 352 | } 353 | css[`body[dir=rtl] #commands > dt.up.right-${valueLeft} > .arrow`] = { 354 | 'border-right-color': colorLeft, 355 | } 356 | css[`body[dir=ltr] #commands > dt.selected.up.right-${valueLeft} > .arrow`] = { 357 | 'border-left-color': colorLeftSelected, 358 | } 359 | css[`body[dir=rtl] #commands > dt.selected.up.right-${valueLeft} > .arrow`] = { 360 | 'border-right-color': colorLeftSelected, 361 | } 362 | css[`body[dir=ltr] #commands > dt.dn.left-${valueLeft} > .arrow`] = { 363 | 'border-right-color': colorLeft, 364 | } 365 | css[`body[dir=rtl] #commands > dt.dn.left-${valueLeft} > .arrow`] = { 366 | 'border-left-color': colorLeft, 367 | } 368 | css[`body[dir=ltr] #commands > dt.selected.dn.left-${valueLeft} > .arrow`] = { 369 | 'border-right-color': colorLeftSelected, 370 | }; 371 | css[`body[dir=rtl] #commands > dt.selected.dn.left-${valueLeft} > .arrow`] = { 372 | 'border-left-color': colorLeftSelected, 373 | }; 374 | 375 | ['stash', 'workspace', 'index', 'local_repo', 'remote_repo'].forEach(function (valueRight, index) { 376 | // if (valueLeft != valueRight) { 377 | 378 | const colorRight = colors[valueRight].saturate(-10).darken(10) 379 | 380 | css[`body[dir=ltr] #commands > dt.left-${valueLeft}.right-${valueRight}`] = { 381 | background: `linear-gradient(to right, ${colorLeft}, ${colorRight})`, 382 | } 383 | css[`body[dir=ltr] #commands > dt.selected.left-${valueLeft}.right-${valueRight}`] = { 384 | background: `linear-gradient(to right, ${colorLeftSelected}, ${colorRight.darken(10)})`, 385 | } 386 | css[`body[dir=rtl] #commands > dt.left-${valueLeft}.right-${valueRight}`] = { 387 | background: `linear-gradient(to left, ${colorLeft}, ${colorRight})`, 388 | } 389 | css[`body[dir=rtl] #commands > dt.selected.left-${valueLeft}.right-${valueRight}`] = { 390 | background: `linear-gradient(to left, ${colorLeftSelected}, ${colorRight.darken(10)})`, 391 | } 392 | // } 393 | }) 394 | }) 395 | 396 | Csster.addPropertyNames([ 397 | 'transition-delay', 398 | 'transition-duration', 399 | 'transition-property', 400 | ]) 401 | 402 | const fs = require('fs') 403 | 404 | twelve00 = fs.readFileSync('./src/lib/1200.css') 405 | 406 | fs.writeFile('./git-cheatsheet/styles.css', 407 | `/* DO NOT EDIT! Generated ${new Date()} */\n` 408 | + twelve00.toString() 409 | + Csster.buildCss(css), err => { 410 | if (err) 411 | console.error(err) 412 | else 413 | console.log('File written successfully.') 414 | }) 415 | -------------------------------------------------------------------------------- /src/git-cheatsheet.js: -------------------------------------------------------------------------------- 1 | import jQuery from 'jquery' 2 | import { detectLanguage, esc, next, prev } from './base.mjs' 3 | 4 | import { commands, locations } from './commands.mjs' 5 | 6 | import { cookies } from './cookies.mjs' 7 | 8 | const $ = jQuery 9 | const Rx = require('./lib/rx.lite') 10 | const Observable = Rx.Observable 11 | 12 | const en = require('../git-cheatsheet/lang/en.json') 13 | const translations = { en } 14 | 15 | let clickMode = false 16 | 17 | const KEY_1 = 49 18 | const KEY_2 = 50 19 | const KEY_3 = 51 20 | const KEY_4 = 52 21 | const KEY_5 = 53 22 | const KEY_H = 72 23 | const KEY_I = 73 24 | const KEY_J = 74 25 | const KEY_K = 75 26 | const KEY_L = 76 27 | const KEY_O = 79 28 | const KEY_R = 82 29 | const KEY_S = 83 30 | const KEY_W = 87 31 | const KEY_FN1 = 112 32 | const KEY_FN2 = 113 33 | const KEY_FN3 = 114 34 | const KEY_FN4 = 115 35 | const KEY_FN5 = 116 36 | const KEY_PAGE_UP = 38 37 | const KEY_PAGE_DN = 40 38 | const KEY_PAGE_LEFT = 37 39 | const KEY_PAGE_RGHT = 39 40 | 41 | 42 | function showDocs (doc, cmd) { 43 | const $info = $('#info') 44 | if (doc) { 45 | $info.find('.cmd').html('' + cmd + ''); 46 | $info.find('.doc').html(doc); 47 | $info.show() 48 | } else { 49 | $info.slideUp() 50 | } 51 | } 52 | 53 | function showDocsForElement (el) { 54 | const $el = $(el), 55 | doc = $el.attr('data-docs') || '', 56 | cmd = $el.text() 57 | showDocs(doc, cmd) 58 | } 59 | 60 | 61 | function currentLoc () { 62 | 63 | const diagram = document.getElementById('diagram'), 64 | el = (diagram && diagram.querySelector('.loc.current')) || null, 65 | loc = el ? el.id : null 66 | 67 | return loc 68 | } 69 | 70 | function selectLoc (id) { 71 | 72 | id = id || '' 73 | 74 | clickMode = false; 75 | $('#commands>div').removeClass('selected'); 76 | $('body') 77 | .removeClass(locations) 78 | .addClass(id) 79 | 80 | $('#diagram .loc.current').removeClass('current'); 81 | 82 | if (id) { 83 | $(`#${id}`).addClass('current') 84 | showDocsForElement(document.getElementById(id)) 85 | } 86 | 87 | const title = '' + id.replace('_', ' ') + ' :: Git Cheatsheet :: NDP Software' 88 | 89 | if (!window.location.hash.match(RegExp('loc=' + id))) { 90 | 91 | window.document.title = title 92 | 93 | if (window.history && window.history.replaceState) { 94 | const newUrl = window.location.href.replace(/#.*/, '') + '#loc=' + id + ';' 95 | window.history.replaceState(null, 96 | title, 97 | newUrl) 98 | } else { 99 | window.location.href = '#loc=' + id + ';' 100 | } 101 | gtag('event', 'select-loc', { category: 'git-cheatsheet', label: id }) 102 | } 103 | } 104 | 105 | function showDocsForCmdEl (cmdEl) { 106 | const $cmdEl = $(cmdEl), 107 | doc = $cmdEl.next('dd').text() || '', 108 | cmd = 'git ' + $cmdEl.html() 109 | 110 | showDocs(doc, cmd) 111 | 112 | return `git {$cmdEl.text()}` 113 | } 114 | 115 | function selectCommand (newEl) { 116 | $('#commands>dt.selected').removeClass('selected') 117 | 118 | if (!newEl) return 119 | 120 | $(newEl).addClass('selected') 121 | 122 | const cmd = showDocsForCmdEl(newEl) 123 | 124 | gtag('event', 'select', { category: 'git-cheatsheet', label: cmd }) 125 | } 126 | 127 | const popStateLoc$ = Observable.fromEvent(window, 'popstate') 128 | .startWith(null) // on initial page view 129 | .map(function () { 130 | const m = (window.location.hash || '').match(/loc=([^;]*);/) 131 | if (m && m.length === 2) { 132 | return m[1] 133 | } 134 | }) 135 | .filter(function (loc) { 136 | return !!loc || loc === '' 137 | }) 138 | 139 | const clickLoc$ = Observable.fromEvent(document, 'click', '#diagram .loc') 140 | .filter(function (ev) { 141 | return $(ev.target).closest('dt').length === 0 142 | }) 143 | .map(function (ev) { 144 | return $(ev.target).hasClass('loc') ? 145 | ev.target : 146 | $(ev.target).closest('.loc')[0] 147 | }) 148 | .filter(function (target) { 149 | return !!target 150 | }) 151 | .map(function (target) { 152 | return target.id 153 | }) 154 | 155 | const clickCmd$ = Observable.fromEvent(document, 'click', '#commands > dt') 156 | .map(function (ev) { 157 | return $(ev.target).is('dt') ? ev.target : $(ev.target).closest('dt').get(0) 158 | }) 159 | .filter(function (el) { 160 | return !!el 161 | }) 162 | .map(function (el) { 163 | clickMode = !clickMode || (clickMode && !$(el).hasClass('selected')) 164 | return clickMode ? el : '#nothing' 165 | }) 166 | 167 | const mouseOverDataDoc$ = Observable.fromEvent(document, 'mousemove', '[data-docs]') 168 | .debounce(100) 169 | .filter(function (ev) { 170 | return !$(ev.target).is('dt') && $(ev.target).closest('dt').length == 0 171 | }) 172 | .map(function (ev) { 173 | return $(ev.target).is('[data-docs]') ? ev.target : $(ev.target).closest('[data-docs]').get(0) 174 | }) 175 | .filter(function (el) { 176 | return !clickMode || !$(el).hasClass('loc') 177 | }) 178 | .distinctUntilChanged() 179 | 180 | const mouseOverCmd$ = Observable.fromEvent(document, 'mousemove', '#commands>dt:not(:selected)') 181 | .filter(function () { 182 | return !clickMode 183 | }) 184 | .map(function (ev) { 185 | return $(ev.target).is('dt') ? ev.target : $(ev.target).closest('dt').get(0) 186 | }) 187 | .filter(function (el) { 188 | return $(el).is('dt') 189 | }) 190 | .distinctUntilChanged() 191 | 192 | const keydown$ = Observable.fromEvent(document, 'keydown') 193 | 194 | const keyDownNextLoc$ = keydown$ 195 | .filter(e => e.keyCode == KEY_PAGE_RGHT || e.keyCode == KEY_L) 196 | .tap(e => e.preventDefault()) 197 | .map(e => next(locations, currentLoc())) 198 | 199 | const keyDownPrevLoc$ = keydown$ 200 | .filter(e => e.keyCode == KEY_PAGE_LEFT || e.keyCode == KEY_H) 201 | .tap(e => e.preventDefault()) 202 | .map(e => prev(locations, currentLoc())) 203 | 204 | const specificLoc$ = keydown$ 205 | .filter(e => !e.ctrlKey) 206 | .filter(e => !e.metaKey) 207 | .tap(e => e.preventDefault()) 208 | .pluck('keyCode') 209 | .map(function (keyCode) { 210 | switch (keyCode) { 211 | case KEY_1: 212 | case KEY_FN1: 213 | case KEY_S: 214 | return 'stash' 215 | case KEY_2: 216 | case KEY_FN2: 217 | case KEY_W: 218 | return 'workspace' 219 | case KEY_3: 220 | case KEY_FN3: 221 | case KEY_I: 222 | return 'index' 223 | case KEY_4: 224 | case KEY_FN4: 225 | case KEY_O: 226 | return 'local_repo' 227 | case KEY_5: 228 | case KEY_FN5: 229 | case KEY_R: 230 | return 'remote_repo' 231 | } 232 | }) 233 | .filter(function (loc) { 234 | return !!loc 235 | }) 236 | 237 | // Select a Loc 238 | clickLoc$ 239 | .merge(keyDownNextLoc$) 240 | .merge(keyDownPrevLoc$) 241 | .merge(popStateLoc$) 242 | .merge(specificLoc$) 243 | .subscribe(selectLoc) 244 | 245 | const visibleCmds = () => { 246 | let curr = $('#diagram .loc.current') 247 | return curr 248 | ? $(`#commands > dt.${curr.attr('id')}`).toArray() 249 | : $(`#commands > dt`).toArray() 250 | } 251 | 252 | const keyDownNextCmd$ = keydown$ 253 | .filter(e => e.keyCode === KEY_PAGE_DN || e.keyCode === KEY_J) 254 | .tap(e => e.preventDefault()) 255 | 256 | const nextCmd$ = keyDownNextCmd$ 257 | .map(() => next(visibleCmds(), $('#commands>dt.selected')[0])) 258 | 259 | const keyDownPrevCmd$ = keydown$ 260 | .filter(e => e.keyCode == KEY_PAGE_UP || e.keyCode == KEY_K) 261 | .tap(e => e.preventDefault()) 262 | 263 | const prevCmd$ = keyDownPrevCmd$ 264 | .map(() => prev(visibleCmds(), $('#commands>dt.selected')[0])) 265 | 266 | 267 | nextCmd$ 268 | .merge(prevCmd$) 269 | .merge(mouseOverCmd$) 270 | .merge(clickCmd$) 271 | .filter(el => !!el) 272 | .subscribe(selectCommand) 273 | 274 | mouseOverDataDoc$.subscribe(function (el) { 275 | showDocsForElement(el) 276 | gtag('event', 'mouseover', { category: 'git-cheatsheet', label: $(el).text() }) 277 | }) 278 | 279 | function translateLocations (lang) { 280 | eachLocation(function (loc) { 281 | $('#' + loc) 282 | .attr('data-docs', esc(translations[lang].locations.docs[loc])) 283 | .find('h5') 284 | .html(translations[lang].locations[loc]) 285 | }) 286 | } 287 | 288 | function rebuildCommands (commands, translations) { 289 | const $commands = $('#commands') 290 | $commands.empty() 291 | 292 | for (let c of commands) { 293 | const cmd = translations.commands[c.key].cmd 294 | const $e = $("
" + esc(cmd) + "
") 295 | .addClass(c.left) 296 | .addClass(c.right) 297 | .addClass(`left-${c.left}`) 298 | .addClass(`right-${c.right}`) 299 | .addClass(c.direction) 300 | .prop('id', `cmd/${c.key}`) 301 | $commands.append($e); 302 | 303 | const docs = translations.commands[c.key].docs 304 | if (docs) { 305 | const $doc = $('
').text(esc(docs)) 306 | $commands.append($doc) 307 | } 308 | } 309 | } 310 | 311 | 312 | 313 | function positionCommands (commands) { 314 | 315 | const cmds = document.getElementById('commands') 316 | 317 | function rtl ({ cmd, el }) { 318 | 319 | let left = bars[cmd.right].left 320 | let right = bars[cmd.left].left 321 | 322 | if ((right - left) < 1) { 323 | left -= Math.min(90, left + 10) 324 | right = left + 220 325 | } else { 326 | left += 20 327 | } 328 | 329 | $(el) 330 | .css('width', right - left + 'px') 331 | .css('right', `${cmds.offsetWidth - right}px`) 332 | } 333 | 334 | function ltr ({cmd, el}) { 335 | let left = bars[cmd.left].left 336 | let width = bars[cmd.right].left - left 337 | if (width < 1) { 338 | left -= Math.min(90, left + 10) 339 | width = 220 340 | } else { 341 | left += 10 342 | width -= 20 343 | } 344 | 345 | $(el) 346 | .css('width', width + 'px') 347 | .css('left', left + 'px') 348 | } 349 | 350 | const bars = {} 351 | eachLocation(loc => { 352 | const bar = document.getElementById(loc) 353 | bars[loc] = { 354 | bar, 355 | left: bar.offsetLeft + bar.querySelector('div.bar').offsetLeft, 356 | } 357 | }) 358 | 359 | eachCommand(commands, $('body').attr('dir') === 'rtl' ? rtl : ltr) 360 | } 361 | 362 | async function loadTranslations (lang) { 363 | return await fetch(`/git-cheatsheet/lang/${lang}.json`) 364 | .then(r => r.json()) 365 | .then(r => translations[lang] = r) 366 | .then(() => true) 367 | .catch(() => false) 368 | } 369 | 370 | 371 | function eachLocation (f) { 372 | locations.forEach(f) 373 | } 374 | 375 | function eachCommand (commands, f) { 376 | for (let c of commands) f({ cmd: c, el: document.getElementById(`cmd/${c.key}`) }) 377 | } 378 | 379 | let direction = 'ltr' 380 | 381 | $(function () { 382 | 383 | $('.loc').append('
') 384 | 385 | async function onChooseLang (lang) { 386 | 387 | // Fallback to English if the language is not translated 388 | if (!translations[lang] && !await loadTranslations(lang)) 389 | lang = 'en' 390 | 391 | $('html').attr('lang', lang) 392 | direction = translations[lang].dir || 'ltr' 393 | $('body').css('direction', direction) 394 | $('body').attr('dir', direction) 395 | $('[data-lang]').removeClass('selected') 396 | $('[data-lang=' + lang + ']').addClass('selected') 397 | 398 | translateLocations(lang) 399 | rebuildCommands(commands, translations[lang]) 400 | positionCommands(commands) 401 | setTimeout(() => positionCommands(commands), 5000) 402 | 403 | return lang 404 | } 405 | 406 | let lang = detectLanguage(navigator) 407 | lang = onChooseLang(lang) 408 | 409 | $('.lang').on('click', function () { 410 | const newLang = $(this).attr('data-lang') 411 | cookies.create('lang', newLang) 412 | gtag('event', 'lang', { category: 'git-cheatsheet', label: newLang }) 413 | 414 | lang = onChooseLang(newLang) 415 | }) 416 | 417 | Observable 418 | .fromEvent(window, 'resize') 419 | .debounce(333) 420 | .subscribe(() => positionCommands(commands)) 421 | 422 | if (currentLoc() === null) selectLoc('index') 423 | }) 424 | -------------------------------------------------------------------------------- /src/lib/csster.js: -------------------------------------------------------------------------------- 1 | // Csster version 1.3.2; Copyright (c) Andrew J. Peterson / ndpsoftware.com. All Rights Reserved 2 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Csster=e():t.Csster=e()}(("object"===typeof window)&&window||{},(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return i}));const o={};if("undefined"!=typeof navigator){const t=function(t){t=t.toLowerCase();const e=/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||!/compatible/.test(t)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}}(navigator.userAgent);t.browser&&(o[t.browser]=!0,o.version=t.version)}const i=()=>void 0!==t&&t.browserOverride?t.browserOverride:o}).call(this,r(4))},function(t,e,r){r(2),t.exports=r(3)},function(t,e){"undefined"!=typeof jQuery&&(jQuery.fn.csster=function(t){var e={};return e[this.selector]=t,Csster.style(e),this})},function(t,e,r){t.exports=r(5).Csster},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"Csster",(function(){return at}));var o={};r.r(o),r.d(o,"setConfig",(function(){return C})),r.d(o,"addNames",(function(){return M})),r.d(o,"error",(function(){return O}));var i={};function n(t){var e=t.length;return function r(){var o=Array.prototype.slice.call(arguments,0);return o.length>=e?t.apply(null,o):function(){var t=Array.prototype.slice.call(arguments,0);return r.apply(null,o.concat(t))}}}r.r(i),r.d(i,"roundedCorners",(function(){return L})),r.d(i,"boxShadow",(function(){return E})),r.d(i,"horizontalCentering",(function(){return G})),r.d(i,"verticalCentering",(function(){return X})),r.d(i,"linearGradient",(function(){return D})),r.d(i,"clearfix",(function(){return Y})),r.d(i,"imageReplacement",(function(){return Z}));const a=function(){var t=arguments;return function(){for(var e=arguments,r=t.length;r-- >0;)e=[t[r].apply(this,e)];return e[0]}},s=(t,...e)=>{for(let r=0;r{if("object"!=typeof e)return e;let r={};for(let o in e)r[t(o)]=e[o];return r}),c=n((function(t,e){if("object"==typeof e)for(let r in e)"object"==typeof e[r]&&t(e[r],r);return e})),d=n((function(t,e){if("object"!=typeof e)return e;let r={};for(let o in e){let i=t(e[o],o);"object"==typeof i&&(i=d(t,i)),r[o]=i}return r})),u=n((function(t,e){let r=t(e);for(let e in r)"object"==typeof r[e]&&(r[e]=u(t,r[e]));return r})),b=t=>"object"==typeof t&&"[object Array]"===Object.prototype.toString.call(t),f=(t,e)=>{for(let r=0;r((t,e,r)=>(f(t,(function(t,o){e=r(e,t,o)})),e))(t,[],(function(t,e){return b(e)?t.concat(p(e)):(t.push(e),t)}));const m=n((t,e)=>"string"==typeof e?t(e):e),g=m(t=>t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))),h=m((function(t){return(t||"").replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g,"")}));let k={has:y,mixin:y,mixins:y};function w(t){return!!k[t]}function y(...t){const e={};return function(t,e){let r=[];if(b(e))for(let o=0;o{"function"==typeof t&&(t=t()),s(e,t)},t),e}const x=u((function t(e){if("object"!=typeof e)return e;const r={};for(let o in e){const i=e[o];if(w(o)){const e=k[o].apply(null,b(i)?i:[i]);s(r,t(e))}else r[o]=i}return r}));function v(t,e){const r=e.split(",");for(let e=0;e{for(;t.match(/.*#.*#.*/);)t=t.replace(/^.*#.*#/,"#");return t});const j={},S={strictNames:!0,anyBrowserExtension:!0};function C(t,e){S[t]=e}function M(...t){const e=p([t]);for(let t of e)j[t]=!0}function O(t){if(/^\-\w+\-/.exec(t)){if(!S.anyBrowserExtension&&!j[t])return'Unrecognized "'+t+'" browser extension property name'}else if(S.strictNames&&!j[t])return'Unrecognized "'+t+'" property name';return null}M(["-webkit-line-clamp",":active","additive-symbols","::after (:after)","align-content","align-items","align-self","align-tracks","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","@annotation","annotation",":any-link","appearance","aspect-ratio","attr","::backdrop","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size",":blank","bleed","block-overflow","block-size","blur","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","@bottom-center","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","brightness","calc","caption-side","caret-color","ch","@character-variant","character-variant","@charset",":checked","circle","clamp","clear","clip","clip-path","cm","color","color-adjust","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","conic-gradient","contain","content","content-visibility","contrast","counter-increment","counter-reset","counter-set","@counter-style","counters","cross-fade","cubic-bezier","::cue","::cue-region",":current","cursor",":default",":defined","deg",":dir","direction",":disabled","display","","dpcm","dpi","dppx","drop-shadow","E","element","ellipse","em",":empty","empty-cells",":enabled","env","ex","F","fallback","filter",":first",":first-child","::first-letter (:first-letter)","::first-line (:first-line)",":first-of-type","fit-content","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float",":focus",":focus-visible",":focus-within","font","font-display","@font-face","font-family","font-family","font-feature-settings","font-feature-settings","@font-feature-values","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-stretch","font-style","font-style","font-synthesis","font-variant","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-variation-settings","font-weight","font-weight","forced-color-adjust","format","fr",":fullscreen",":future","G","gap","grad","::grammar-error","grayscale","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","Hz","hanging-punctuation",":has","height","height","@historical-forms",":host",":host-context",":hover","hsl","hsla","hue-rotate","hyphens","image","image-orientation","image-rendering","image-resolution","image-set","@import","in",":in-range",":indeterminate","inherit","inherits","initial","initial-letter","initial-letter-align","initial-value","inline-size","inset","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start",":invalid","invert",":is","isolation","justify-content","justify-items","justify-self","justify-tracks","kHz","@keyframes",":lang",":last-child",":last-of-type","leader",":left","left","@left-bottom","letter-spacing","line-break","line-clamp","line-height","line-height-step","linear-gradient",":link","list-style","list-style-image","list-style-position","list-style-type","local",":local-link","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","::marker","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-style","matrix","matrix3d","max","max-block-size","max-height","max-height","max-inline-size","max-lines","max-width","max-width","max-zoom","@media","min","min-block-size","min-height","min-height","min-inline-size","min-width","min-width","min-zoom","minmax","mix-blend-mode","mm","ms","@namespace","negative",":not",":nth-child",":nth-col",":nth-last-child",":nth-last-col",":nth-last-of-type",":nth-of-type","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate",":only-child",":only-of-type","opacity","opacity",":optional","order","orientation","@ornaments","ornaments","orphans",":out-of-range","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-inline","overflow-wrap","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","Pseudo-classes","Pseudo-elements","pad","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","@page","page-break-after","page-break-before","page-break-inside","paint","paint-order","::part",":past","path",":paused","pc","perspective","perspective","perspective-origin",":picture-in-picture","place-content","place-items","place-self","::placeholder",":placeholder-shown",":playing","pointer-events","polygon","position","prefix","@property","pt","px","quotes","rad","radial-gradient","range",":read-only",":read-write","rect","rem","repeat","repeating-linear-gradient","repeating-radial-gradient",":required","resize","revert","rgb","rgba",":right","right","@right-bottom",":root","rotate","rotate","rotate3d","rotateX","rotateY","rotateZ","row-gap","ruby-align","ruby-merge","ruby-position","saturate","scale","scale","scale3d","scaleX","scaleY","scaleZ",":scope","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","::selection","selector","sepia","shape-image-threshold","shape-margin","shape-outside","size","skew","skewX","skewY","::slotted","speak-as","::spelling-error","src","steps","@styleset","styleset","@stylistic","stylistic","suffix","@supports","@swash","swash","symbols","symbols","syntax","system","tab-size","table-layout",":target","target-counter","target-counters","target-text",":target-within","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","top","@top-center","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","translate","translate3d","translateX","translateY","translateZ","turn","unicode-bidi","unicode-range","unset","url",":user-invalid","user-select","user-zoom",":valid","var","vertical-align","vh","@viewport","viewport-fit","visibility",":visited","vmax","vmin","vw",":where","white-space","widows","width","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","zoom"]),M(["-moz-binding","-moz-border-radius","-moz-border-radius-topleft","-moz-border-radius-topright","-moz-border-radius-bottomright","-moz-border-radius-bottomleft","-moz-border-top-colors","-moz-border-right-colors","-moz-border-bottom-colors","-moz-border-left-colors","-moz-box-shadow","-moz-opacity","-moz-outline","-moz-outline-color","-moz-outline-style","-moz-outline-width","-moz-user-focus","-moz-user-input","-moz-user-modify","-moz-user-select"]),M(["-webkit-animation","-webkit-animation-delay","-webkit-animation-direction","-webkit-animation-duration","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-play-state","-webkit-animation-timing-function","-webkit-appearance","-webkit-backface-visibility","-webkit-background-clip","-webkit-background-composite","-webkit-background-origin","-webkit-background-size","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius","-webkit-border-horizontal-spacing","-webkit-border-image","-webkit-border-radius","-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-border-vertical-spacing","-webkit-box-align","-webkit-box-direction","-webkit-box-flex","-webkit-box-flex-group","-webkit-box-lines","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-reflect","-webkit-box-shadow","-webkit-box-sizing","-webkit-column-break-after","-webkit-column-break-before","-webkit-column-break-inside","-webkit-column-count","-webkit-column-gap","-webkit-column-rule","-webkit-column-rule-color","-webkit-column-rule-style","-webkit-column-rule-width","-webkit-column-width","-webkit-columns","-webkit-dashboard-region","-webkit-line-break","-webkit-margin-bottom-collapse","-webkit-margin-collapse","-webkit-margin-start","-webkit-margin-top-collapse","-webkit-marquee","-webkit-marquee-direction","-webkit-marquee-increment","-webkit-marquee-repetition","-webkit-marquee-speed","-webkit-marquee-style","-webkit-mask","-webkit-mask-attachment","-webkit-mask-box-image","-webkit-mask-clip","-webkit-mask-composite","-webkit-mask-image","-webkit-mask-origin","-webkit-mask-position","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-repeat","-webkit-mask-size","-webkit-nbsp-mode","-webkit-padding-start","-webkit-perspective","-webkit-perspective-origin","-webkit-rtl-ordering","-webkit-tap-highlight-color","-webkit-text-fill-color","-webkit-text-security","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-touch-callout","-webkit-transform","-webkit-transform-origin","-webkit-transform-origin-x","-webkit-transform-origin-y","-webkit-transform-origin-z","-webkit-transform-style","-webkit-transition","-webkit-transition-delay","-webkit-transition-duration","-webkit-transition-property","-webkit-transition-timing-function","-webkit-user-drag","-webkit-user-modify","-webkit-user-select"]);const q=l(g),H=c((t,e)=>{for(let r in t){let t=O(r);if(t)throw t+'. Context: "'+e+'"'}}),T=a(H,d(q),t=>{const e={};return function t(r,o){for(var i in r){const l=r[i];if(z(i,l)){t(l,v(o,i))}else a=i,s=l,n=h(n=o),e[n]=e[n]||{},e[n][a]&&console.log("Replacing property ",a," in ",n,"; ",e[n][a]," => ",s),e[n][a]=s}var n,a,s}(t,""),e},x);const A=function(t){const e=g(t);return O(e)?null:e},N=["z-index","opacity","zoom"],P=(t,e)=>(t=>A(t))(t)+": "+((t,e)=>t+(t&&"number"==typeof t&&-1==N.indexOf(e)?"px":""))(e,t)+";\r",R=t=>{return t.sel+" { "+(e=t.props,Object.keys(e).reduce((t,r)=>t+P(r,e[r]),"")+" }\n");var e};const B=a((function(t){return t.reduce((t,e)=>t+R(e),"")}),(function(t){const e=p([t]),r=[];return f(e,t=>r.push(function(t){const e=[];for(let r in t)e.push({sel:r,props:t[r]});return e}(T(t)))),p(r)}));var I=function(t){const e=document.createElement("STYLE"),r=document.createAttribute("type");r.nodeValue="text/css",e.setAttributeNode(r);document.getElementsByTagName("HEAD")[0].appendChild(e);try{e.appendChild(document.createTextNode(t))}catch(e){const r=document.styleSheets[document.styleSheets.length-1];r.cssText=""+r.cssText+t}};function L(t,e){if(e||(e=t||10,t="all"),"all"==t)return{"-moz-border-radius":e,"border-radius":e,"-webkit-border-radius":e};var r={};return"tl"!=t&&"top"!=t&&"left"!=t||(r["-moz-border-radius-topleft"]=e,r["-webkit-border-top-left-radius"]=e,r["border-top-left-radius"]=e),"tr"!=t&&"top"!=t&&"right"!=t||(r["-webkit-border-top-right-radius"]=e,r["-moz-border-radius-topright"]=e,r["border-top-right-radius"]=e),"bl"!=t&&"bottom"!=t&&"left"!=t||(r["-webkit-border-bottom-left-radius"]=e,r["-moz-border-radius-bottomleft"]=e,r["border-bottom-left-radius"]=e),"br"!=t&&"bottom"!=t&&"right"!=t||(r["-webkit-border-bottom-right-radius"]=e,r["-moz-border-radius-bottomright"]=e,r["border-bottom-right-radius"]=e),r}function E(t,e,r){var o,i,n,a;if(void 0===t.length)throw"Not yet supported";if(2!=t.length)throw"boxShadow requires a direction (degree) or [xOffset, yOffset] in px measurements.";return{"-moz-box-shadow":(o=t[0])+"px "+(i=t[1])+"px "+e+"px "+r,"-webkit-box-shadow":o+"px "+i+"px "+e+"px "+r,boxShadow:o+"px "+i+"px "+e+"px "+r,"-ms-filter":"progid:DXImageTransform.Microsoft.Shadow(Strength="+(n=4)+", Direction="+(a=135)+", Color='"+r+"')",filter:"progid:DXImageTransform.Microsoft.Shadow(Strength="+n+", Direction="+a+", Color='"+r+"')"}}function G(t){return{width:t,position:"absolute",left:"50%",marginLeft:-t/2}}function X(t){return{height:t,position:"absolute",top:"50%",marginTop:-t/2}}var _=r(0);function D(t,e,r,o){let i="",n="";Object(_.a)().webkit?i="-webkit":Object(_.a)().mozilla&&(i="-moz");const a=[];for(var s=0;s0&&(a-=1)}a=Math.round(360*a),a<0&&(a+=360);const c=U(this);return c.hsl=[a,Math.round(100*s),Math.round(100*l)],c.hsl},it=function(t,e,r){function o(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function i(t){let e=Math.round(t).toString(16);return 1==e.length&&(e="0"+e),e.substr(0,1)+e.substr(1,1)}b(t)&&(r=t[2]||0,e=t[1]||0,t=t[0]||0);const n=function(t,e,r){let i,n,a;if(0==e)i=255*r,n=255*r,a=255*r;else{const s=r<.5?r*(1+e):r+e-e*r,l=2*r-s;i=255*o(l,s,t+1/3),n=255*o(l,s,t),a=255*o(l,s,t-1/3)}return[i,n,a]}(t=(t+360)%360/360,e/=100,r/=100);return"#"+i(n[0])+i(n[1])+i(n[2])},nt=M,at={buildCss:B,insertCss:I,style:a(I,B),macros:i,setMacro:function(t,e){k[t]=e},arrayFlatten:p,browserInfo:_.a,hslToHexColor:it,addPropertyNames:nt,propertyNameValidator:o,colorizeString:()=>{String.prototype.toHexColor=V,String.prototype.toRGB=$,String.prototype.red=J,String.prototype.green=K,String.prototype.blue=W,String.prototype.lighten=tt,String.prototype.darken=et,String.prototype.saturate=rt,String.prototype.toHSL=ot}}}])})); 3 | --------------------------------------------------------------------------------