Hands-on Git Tasks - Part #3 of 5 | Navigating Project Branches

This post is part of a 5-post series on using Git.

Hands-on Git Tasks - Part #1 of 5 | First Git Commit

Hands-on Git Taks - Part #2 of 5 | Checking Git Objects

Hands-on Git Tasks - Part #3 of 5 | Navigating Project Branches

Hands-on Git Tasks - Part #4 of 5 | Using Remote Repository

Hands-On Git Tasks - Part #5 of 5 | Merging

Follow these steps for an example of how to navigate the branches of your project in your AWS Cloud9 environment. (For steps to create your Cloud9 Environment, go here: https://medium.com/@lewislampkin/creating-an-integrated-developer-environment-ide-in-the-cloud-in-two-minutes-c96e33b2fa3e)

01. Check the log
git log
git log --oneline
Notice that the HEAD is currently pointing to the main branch.

02. List the files
ls

03. Move to the first commit using the checkout commad
git checkout [hash]
Note: can use the full hash, or the shorter version from the "git log --oneline" This shows us what the repository looked like during the first commit

04. check git log again
git log

05. List the files from first commit
ls

06. Move to the 'Main' branch using the checkout command
git checkout main

07. check the log
git log

08. List files in the 'Main' branch
ls

If you want to find me, you can catch me, Lewis Lampkin, III at LinkedIn: https://www.linkedin.com/in/lewislampkin

If you want to read my blog: https://www.lewislampkin.com

Comments

Popular posts from this blog

Orphaned No More: Adopting AWS Lambda

Containing the Chaos! | A Three-Part Series Demonstrating the Usefulness of Containerization to HumanGov