feat: use switch instead of checkout
This commit is contained in:
@@ -112,7 +112,7 @@ The verification will check that:
|
||||
2. You're currently on the development branch
|
||||
3. View the commits: `git log --oneline`
|
||||
4. You'll see several commits - identify the bug fixes
|
||||
5. Switch to main branch: `git checkout main`
|
||||
5. Switch to main branch: `git switch main`
|
||||
6. Cherry-pick the bug fix commits (you'll need their commit hashes)
|
||||
7. Verify the result with `git log --oneline`
|
||||
8. Run the verification script
|
||||
@@ -131,7 +131,7 @@ The verification will check that:
|
||||
### Hotfix to Production
|
||||
You have a critical bug fix on a development branch that needs to go to production immediately:
|
||||
```bash
|
||||
git checkout production
|
||||
git switch production
|
||||
git cherry-pick <bugfix-commit-hash>
|
||||
```
|
||||
|
||||
@@ -141,17 +141,17 @@ You accidentally committed on the wrong branch:
|
||||
# On wrong branch, note the commit hash
|
||||
git log --oneline
|
||||
# Switch to correct branch
|
||||
git checkout correct-branch
|
||||
git switch correct-branch
|
||||
git cherry-pick <commit-hash>
|
||||
# Go back and remove from wrong branch
|
||||
git checkout wrong-branch
|
||||
git switch wrong-branch
|
||||
git reset --hard HEAD~1
|
||||
```
|
||||
|
||||
### Backporting
|
||||
You need to apply a fix to an older release branch:
|
||||
```bash
|
||||
git checkout release-2.0
|
||||
git switch release-2.0
|
||||
git cherry-pick <fix-from-main>
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user