Skip to content

Commit

Permalink
Use switch instead of checkout
Browse files Browse the repository at this point in the history
switch is a better alternative to checkout in terms of complexity.

cf. git/git@d787d31
  • Loading branch information
ken-matsui committed Jan 28, 2024
1 parent a2844de commit 0dfbf72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/tech/info/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ The basic workflow of Git can be summed up in the following graphic:
| `git status` | Shows the current status of your local repository. You will use this to see which files have been changed, added, or deleted |
| `git log` | Shows the commit history of your local repository. You will use this to see the commit messages and commit hashes of your commits |
| `git branch` | Shows the current branch you are on. You will use this to see which branch you are working on |
| `git checkout <branch>` | Switches to the specified branch. You will use this to switch between branches |
| `git checkout -b <branch>` | Creates a new branch and switches to it. You will use this to create a new branch |
| `git switch <branch>` | Switches to the specified branch. You will use this to switch between branches |
| `git switch -c <branch>` | Creates a new branch and switches to it. You will use this to create a new branch |
| `git reset --hard <commit>` | Resets the repository to the specified commit. You will use this to undo changes to your local repository |
| `git reset --hard origin/<branch>` | Resets the repository to the latest commit on the specified branch. You will use this to undo changes to your local repository |
| `git reset --hard HEAD~<number>` | Resets the repository to the specified number of commits ago. You will use this to undo changes to your local repository |
Expand Down

0 comments on commit 0dfbf72

Please sign in to comment.