Add Branches to Git cheatsheet
This commit is contained in:
		
							parent
							
								
									76a19d218d
								
							
						
					
					
						commit
						ddf3dd98db
					
				| @ -1,3 +1,4 @@ | |||||||
|  | 
 | ||||||
| ## Configuration | ## Configuration | ||||||
| 
 | 
 | ||||||
| Set the global config | Set the global config | ||||||
| @ -35,6 +36,26 @@ Add new modifications to the last commit | |||||||
| git commit --amend --no-edit | git commit --amend --no-edit | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | ## Branches | ||||||
|  | 
 | ||||||
|  | Lists all local branches in your repository (use -a for remote local and remote branches): | ||||||
|  | 
 | ||||||
|  | ```shell | ||||||
|  | git branch | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | Switch to an existing branch: | ||||||
|  | 
 | ||||||
|  | ```shell | ||||||
|  | git switch [branch name] | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | Create a new branch: | ||||||
|  | 
 | ||||||
|  | ```shell | ||||||
|  | git checkout -b [branch name] | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
| ## I’ve made a mistake | ## I’ve made a mistake | ||||||
| 
 | 
 | ||||||
| Change last commit message | Change last commit message | ||||||
| @ -74,4 +95,4 @@ Renaming the local master branch to main | |||||||
| 
 | 
 | ||||||
| ```shell | ```shell | ||||||
| git branch -m master main | git branch -m master main | ||||||
| ``` | ``` | ||||||
| @ -6,7 +6,7 @@ export const tool = defineTool({ | |||||||
|   name: translate('tools.git-memo.title'), |   name: translate('tools.git-memo.title'), | ||||||
|   path: '/git-memo', |   path: '/git-memo', | ||||||
|   description: translate('tools.git-memo.description'), |   description: translate('tools.git-memo.description'), | ||||||
|   keywords: ['git', 'push', 'force', 'pull', 'commit', 'amend', 'rebase', 'merge', 'reset', 'soft', 'hard', 'lease'], |   keywords: ['git', 'push', 'force', 'pull', 'commit', 'branch', 'switch', 'checkout', 'amend', 'rebase', 'merge', 'reset', 'soft', 'hard', 'lease'], | ||||||
|   component: () => import('./git-memo.vue'), |   component: () => import('./git-memo.vue'), | ||||||
|   icon: BrandGit, |   icon: BrandGit, | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user