Skip to content

Commit ddf3dd9

Browse files
committed
Add Branches to Git cheatsheet
1 parent 76a19d2 commit ddf3dd9

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/tools/git-memo/git-memo.content.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
## Configuration
23

34
Set the global config
@@ -35,6 +36,26 @@ Add new modifications to the last commit
3536
git commit --amend --no-edit
3637
```
3738

39+
## Branches
40+
41+
Lists all local branches in your repository (use -a for remote local and remote branches):
42+
43+
```shell
44+
git branch
45+
```
46+
47+
Switch to an existing branch:
48+
49+
```shell
50+
git switch [branch name]
51+
```
52+
53+
Create a new branch:
54+
55+
```shell
56+
git checkout -b [branch name]
57+
```
58+
3859
## I’ve made a mistake
3960

4061
Change last commit message
@@ -74,4 +95,4 @@ Renaming the local master branch to main
7495

7596
```shell
7697
git branch -m master main
77-
```
98+
```

src/tools/git-memo/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const tool = defineTool({
66
name: translate('tools.git-memo.title'),
77
path: '/git-memo',
88
description: translate('tools.git-memo.description'),
9-
keywords: ['git', 'push', 'force', 'pull', 'commit', 'amend', 'rebase', 'merge', 'reset', 'soft', 'hard', 'lease'],
9+
keywords: ['git', 'push', 'force', 'pull', 'commit', 'branch', 'switch', 'checkout', 'amend', 'rebase', 'merge', 'reset', 'soft', 'hard', 'lease'],
1010
component: () => import('./git-memo.vue'),
1111
icon: BrandGit,
1212
});

0 commit comments

Comments
 (0)