Skip to content

Commit cf111b4

Browse files
authored
Update README.md
updated git branching with more modern git switch command where appropriate
1 parent ee52c67 commit cf111b4

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,26 +189,25 @@ git push origin master
189189
### Branching
190190
```zsh
191191

192-
git branch "new_feature" # Makes the branch
193-
git checkout "new_feature" # Moves you over the the branch
192+
git switch -c new_feature # Creates and switches to branch
194193
git add -A
195-
git commit -m "small_new_feature" # uploads teh change ONLY to the branch
196-
git push -u origin "new_feature" # slightly complex command that associates the brance with main
197-
git branch -a # To verify
194+
git commit -m "small_new_feature" # commits to branch
195+
git push -u origin new_feature # pushes and sets upstream
196+
git branch -a # verify branches
198197
git add -A && git commit -m "small new feature..."
199198
git push
200-
# Ready to merge with Master Branch
201-
git checkout master
199+
# Ready to merge
200+
git switch master
202201
git pull origin master
203-
git merge "new_feature" # Merges the changes
204-
git push origin master # Uploads the changes to remote repo
205-
#Delete the Branch
206-
git branch -d "new_feature" # will delete localy
207-
git push origin --delte "new_feature" # will delete from remote repo
208-
git branch -s # to verify
209-
# To go back to an old version and branch off
210-
git log --graph --oneline --all --decorate # to see all committs #
211-
git checkout -b new-branch-name 4f8d768 # Creating a new branch from an old commit
202+
git merge new_feature # merges changes
203+
git push origin master # pushes to remote
204+
# Delete branch
205+
git branch -d new_feature # delete locally
206+
git push origin --delete new_feature # delete from remote
207+
git branch -a # verify deletion
208+
# Branch from old commit
209+
git log --oneline --graph --all # see commits
210+
git switch -c new-branch-name 4f8d768 # create branch from old commit
212211
```
213212

214213
### Rolling back to a previous commit

0 commit comments

Comments
 (0)