feat: use switch instead of checkout
This commit is contained in:
@@ -134,7 +134,7 @@ The verification will check that:
|
||||
2. You'll find a simulated "remote" repository
|
||||
3. Clone it: `git clone remote-repo local-repo`
|
||||
4. Navigate into your clone: `cd local-repo`
|
||||
5. Create and switch to a feature branch: `git checkout -b add-feature`
|
||||
5. Create and switch to a feature branch: `git switch -c add-feature`
|
||||
6. Make changes to the project (add a new feature to app.js)
|
||||
7. Commit your changes
|
||||
8. Push to remote: `git push -u origin add-feature`
|
||||
@@ -185,20 +185,20 @@ Safer than pull because it doesn't automatically merge
|
||||
### Daily Work Flow
|
||||
```bash
|
||||
# Start of day: get latest changes
|
||||
git checkout main
|
||||
git switch main
|
||||
git pull origin main
|
||||
|
||||
# Create feature branch
|
||||
git checkout -b my-feature
|
||||
git switch -c my-feature
|
||||
|
||||
# Do work, make commits
|
||||
git add .
|
||||
git commit -m "Add feature"
|
||||
|
||||
# Before pushing, update with latest main
|
||||
git checkout main
|
||||
git switch main
|
||||
git pull origin main
|
||||
git checkout my-feature
|
||||
git switch my-feature
|
||||
git merge main
|
||||
|
||||
# Push your feature
|
||||
@@ -223,7 +223,7 @@ git remote add upstream <original-repo-url>
|
||||
|
||||
# Get latest from upstream
|
||||
git fetch upstream
|
||||
git checkout main
|
||||
git switch main
|
||||
git merge upstream/main
|
||||
|
||||
# Push to your fork
|
||||
|
||||
Reference in New Issue
Block a user