@@ -189,26 +189,25 @@ git push origin master
189
189
### Branching
190
190
``` zsh
191
191
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
194
193
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
198
197
git add -A && git commit -m " small new feature..."
199
198
git push
200
- # Ready to merge with Master Branch
201
- git checkout master
199
+ # Ready to merge
200
+ git switch master
202
201
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
212
211
```
213
212
214
213
### Rolling back to a previous commit
0 commit comments