- Use
git branchto view your current branch
git branch- Rename the
masterbranch tomain
git branch -m oldname newname- Create a new branch called “add_classics”
git branch my_new_branch- Switch to the new branch
git switch my_new_branch- Verify that you are in the new branch
git branch- Add a new file called
classics.mdand put these contents
Friends
The Sopranos
Breaking Bad
I Love Lucy
The Simpsons
- Stage and commit the changes starting with the commit messages “C: ”
- Use
git logon your new branch - Switch back to the
mainbranch - Use
git logon the main branch
The actions described in 3, 4 can be done using
git switch -c my_new_branch