From e0276601fa7a4abca115e47123ac93b56f0faf5b Mon Sep 17 00:00:00 2001 From: Dane Sabo Date: Fri, 23 Aug 2024 13:51:11 -0400 Subject: [PATCH] vault backup: 2024-08-23 13:51:11 --- Learning How to Use Github.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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