Git - Navigating Branches
- Learn how to navigate between the branches of a repository
We now have two branches in our project:
git hist --all
- Switch to the Master Branch
- Just use the git checkout command to switch between branches.
git checkout master cat src/hello.c
We are now on the master branch. We can tell because the hello.c file doesn’t use the Greeter function.
- Switch Back to the Greet Branch.
git checkout greet cat src/hello.c
The contents of the src/hello.c confirms we are back on the greet branch.