diff --git a/Learning How to Use Github.md b/Learning How to Use Github.md index 6729cde78..7fea9cf9f 100755 --- a/Learning How to Use Github.md +++ b/Learning How to Use Github.md @@ -55,4 +55,23 @@ git branch -M master # some people use "main" git remote add origin git@github.com:danesabo/repository.git git push -u origin master +``` + +## Working with branches +```bash +#Create a new branch +git branch new-branch + +#switch to that branch +git checkout new-branch + +#or do both at once +git checkout -b new-branch + +#or even if you're in a newer git version +git switch -c new-branch + +#push the new branch back to remote +git push -u origin new-branch +#git push (set new pushes to new branch spec) (remote destination) (branch name) ``` \ No newline at end of file