diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 2 | ||||
-rw-r--r-- | src/plugins/naive.plugin.ts | 2 | ||||
-rw-r--r-- | src/shims.d.ts | 10 | ||||
-rw-r--r-- | src/tools/git-memo/git-memo.md | 77 | ||||
-rw-r--r-- | src/tools/git-memo/git-memo.vue | 21 | ||||
-rw-r--r-- | src/tools/git-memo/index.ts | 11 | ||||
-rw-r--r-- | src/tools/index.ts | 6 |
7 files changed, 127 insertions, 2 deletions
diff --git a/src/App.vue b/src/App.vue index c58a0ad..eb22b2e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,11 +40,13 @@ body { margin: 0; padding: 0; } + html { height: 100%; margin: 0; padding: 0; } + * { box-sizing: border-box; } diff --git a/src/plugins/naive.plugin.ts b/src/plugins/naive.plugin.ts index 214b747..93da522 100644 --- a/src/plugins/naive.plugin.ts +++ b/src/plugins/naive.plugin.ts @@ -2,7 +2,6 @@ import { create, NButton, NConfigProvider, - NGlobalStyle, NCard, NInput, NColorPicker, @@ -79,7 +78,6 @@ const components = [ NGridItem, NButton, NConfigProvider, - NGlobalStyle, NCard, NInput, NColorPicker, diff --git a/src/shims.d.ts b/src/shims.d.ts new file mode 100644 index 0000000..f8798e5 --- /dev/null +++ b/src/shims.d.ts @@ -0,0 +1,10 @@ +declare module '*.vue' { + import type { ComponentOptions, ComponentOptions } from 'vue'; + const Component: ComponentOptions; + export default Component; +} + +declare module '*.md' { + const Component: ComponentOptions; + export default Component; +} diff --git a/src/tools/git-memo/git-memo.md b/src/tools/git-memo/git-memo.md new file mode 100644 index 0000000..6783ad8 --- /dev/null +++ b/src/tools/git-memo/git-memo.md @@ -0,0 +1,77 @@ +## Configuration + +Set the global config + +```shell +git config --global user.name "[name]" +git config --global user.email "[email]" +``` + +## Get started + +Create a git repository + +```shell +git init +``` + +Clone an existing git repository + +```shell +git clone [url] +``` + +## Commit + +Commit all tracked changes + +```shell +git commit -am "[commit message]" +``` + +Add new modifications to the last commit + +```shell +git commit --amend --no-edit +``` + +## I’ve made a mistake + +Change last commit message + +```shell +git commit --amend +``` + +Undo most recent commit and keep changes + +```shell +git reset HEAD~1 +``` + +Undo the `N` most recent commit and keep changes + +```shell +git reset HEAD~N +``` + +Undo most recent commit and get rid of changes + +```shell +git reset HEAD~1 --hard +``` + +Reset branch to remote state + +```shell +git fetch origin +git reset --hard origin/[branch-name] +``` + +## Miscellaneous + +Renaming the local master branch to main + +```shell +git branch -m master main +``` diff --git a/src/tools/git-memo/git-memo.vue b/src/tools/git-memo/git-memo.vue new file mode 100644 index 0000000..5848ac4 --- /dev/null +++ b/src/tools/git-memo/git-memo.vue @@ -0,0 +1,21 @@ +<template> + <div> + <memo /> + </div> +</template> + +<script setup lang="ts"> +import Memo from './git-memo.md' +import { useThemeVars } from 'naive-ui' + +const themeVars = useThemeVars() +</script> + +<style lang="less" scoped> +::v-deep(pre) { + margin: 0; + padding: 15px 22px; + background-color: v-bind('themeVars.cardColor'); + border-radius: 4px; +} +</style>
\ No newline at end of file diff --git a/src/tools/git-memo/index.ts b/src/tools/git-memo/index.ts new file mode 100644 index 0000000..f1da354 --- /dev/null +++ b/src/tools/git-memo/index.ts @@ -0,0 +1,11 @@ +import { BrandGit } from '@vicons/tabler'; +import type { ITool } from '../Tool'; + +export const tool: ITool = { + name: 'Git cheatsheet', + path: '/git-memo', + description: 'Git is a decentralized version management sofware. With this cheatsheet you will have a quick acces to the most common git commands.', + keywords: ['git', 'push', 'force', 'pull', 'commit', 'ammend', 'rebase', 'merge', 'reset', 'soft', 'hard', 'lease'], + component: () => import('./git-memo.vue'), + icon: BrandGit, +}; diff --git a/src/tools/index.ts b/src/tools/index.ts index d2dde6e..f083ca7 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -8,6 +8,7 @@ import { tool as romanNumeralConverter } from './roman-numeral-converter'; import { tool as cypher } from './encryption'; import { tool as bip39 } from './bip39-generator'; import { tool as dateTimeConverter } from './date-time-converter'; +import { tool as gitMemo } from './git-memo'; export const toolsByCategory: ToolCategory[] = [ { @@ -20,6 +21,11 @@ export const toolsByCategory: ToolCategory[] = [ icon: LockOpen, components: [dateTimeConverter, romanNumeralConverter], }, + { + name: 'Development', + icon: LockOpen, + components: [gitMemo], + }, ]; export const tools = toolsByCategory.flatMap(({ components }) => components); |