These are the steps to follow to update a repository in Github using a new branch. Go to the command line tool…
git clone [repository]
…or if you already have it, refresh it with
git pull origin main
Create a new branch to work in and check it out…
git checkout -b [branchname]
… make any changes then add those changes to the local repo, commit them and push them to Github.
git add -A
git commit -m "message"
git push -u origin [branchname]
Go to Github. Create a pull request and merge the branch with the main. Once complete you can delete the branch.
git checkout main
git pull origin main
All changes should now be reflected in the local main copy.
Other useful commands:
git branch (lists the branches) git status (shows if the branch is up to date and if there is something to commit)