feat: git memo

Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
This commit is contained in:
Corentin Thomasset 2020-06-21 18:42:19 +02:00
parent cb0e3f91db
commit 03e073d4f0
No known key found for this signature in database
GPG key ID: DBD997E935996158
3 changed files with 105 additions and 75 deletions

View file

@ -5,6 +5,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Next ## Next
- [ui] condensed + colored sidenav - [ui] condensed + colored sidenav
- [feat] added [git memo](/#/git-memo)
## 1.3.0 ## 1.3.0
- [fix] [GithubContributors] ordered contributors by contribution count - [fix] [GithubContributors] ordered contributors by contribution count

View file

@ -38,7 +38,7 @@
<style lang="less" scoped> <style lang="less" scoped>
.memo-viewer { .memo-viewer {
column-gap: 30px; column-gap: 30px;
column-rule: 1px solid #373739; column-rule: 1px solid #37373961;
column-fill: auto; column-fill: auto;
} }

View file

@ -17,56 +17,77 @@
export default { export default {
name: "GitMemo", name: "GitMemo",
data: () => ({ data: () => ({
tips: [ tips: [
{ {
section: 'Basic configuration', section: 'Get started',
child:[ child: [
{ {
text: 'Set the name that will be associated to every operation', text: 'Create a git repo',
code: 'git config --global user.name "[nom]"' code: 'git init'
}, },
{ {
text: 'Set the email address that will be associated to every operation', text: 'Clone an existing repository',
code: 'git config --global user.email "[email]"' code: 'git clone [repo url]'
}, },
{ {
text: 'Tell git to always push tags', text: 'Add current files to next commit',
code: 'git config --global push.followTags true' code: 'git add .'
} },
] {
}, text: 'Commit tracked files changes',
{ code: 'git commit -am "[commit message]"'
section: 'Get started', },
child:[ {
{ text: 'List files that has changed',
text: 'Create a git repo', code: 'git status'
code: 'git init' },
}, {
{ text: 'List changes in tracked files',
text: 'Clone an existing repository', code: 'git diff'
code: 'git clone [repo url]' }
}, ]
{ },
text: 'Add current files to next commit', {
code: 'git add .' section: 'Basic configuration',
}, child: [
{ {
text: 'Commit tracked files changes', text: 'Set the name that will be associated to every operation',
code: 'git commit -am "[commit message]"' code: 'git config --global user.name "[nom]"'
}, },
{ {
text: 'List files that has changed', text: 'Set the email address that will be associated to every operation',
code: 'git status' code: 'git config --global user.email "[email]"'
}, },
{ {
text: 'List changes in tracked files', text: 'Tell git to always push tags',
code: 'git diff' code: 'git config --global push.followTags true'
} }
] ]
}, },
{ {
section: 'Setup SSH', section: 'I\'ve made a mistake',
child:[ child: [
{
text: 'Change last commit message',
code: 'git commit --amend'
},
{
text: 'Undo most recent commit and keep changes',
code: 'git reset HEAD~1'
},
{
text: 'Undo most recent commit and get rid of changes',
code: 'git reset HEAD~1 --hard'
},
{
text: 'Reset branch to remote state',
code: 'git fetch origin\ngit reset --hard origin/[branch-name]'
}
]
},
{
section: 'Setup SSH',
child: [
[ [
{ {
text: '1). Generate an SSH key.', text: '1). Generate an SSH key.',
@ -90,30 +111,38 @@
}, },
] ]
] ]
}, },
{ {
section: 'I\'ve made a mistake', section: 'Merge and rebase',
child:[ child: [
{ {
text: 'Change last commit message', text: 'Merge a branch into the current',
code: 'git commit --amend' code: 'git merge [branch]'
}, },
{ {
text: 'Undo most recent commit and keep changes', text: 'Abort merge (conflicts)',
code: 'git reset HEAD~1' code: 'git merge --abort'
}, },
{ {
text: 'Undo most recent commit and get rid of changes', text: 'Continue merge after resolving conflicts',
code: 'git reset HEAD~1 --hard' code: 'git merge --continue'
}, },
{ {
text: 'Reset branch to remote state', text: 'Rebase a branch into the current',
code: 'git fetch origin\ngit reset --hard origin/[branch-name]' code: 'git rebase [branch]'
} },
] {
} text: 'Rebase merge (conflicts)',
] code: 'git merge --abort'
},
{
text: 'Continue rebase after resolving conflicts',
code: 'git merge --continue'
},
]
},
]
}), }),
components: { components: {
MemoViewer MemoViewer