• 20 hours
  • Easy

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 11/28/19

Get Some Practice Managing Your Code!

Log in or subscribe for free to enjoy all this course has to offer!

Now that you've gotten a little theory, try practicing some of these techniques. To get some practice, do the following exercise step by step.

Try It Out For Yourself!

You've applied for a job on the tech team of a large media company.  As part of the team's filtering process, they've sent you a series of skills tests to complete.  Since the company uses GitHub in its day-to-day operations, the first of these tests will check your use of GitHub.

Massive Media Productions
Your (hopefully) future company: Massive Media Operations

For the test, you have to follow a strict list of instructions, document the steps via screenshots, then send your work via a zip file to the HR team for review. The list of instructions are as followed:

  1. Go to the GitHub website to access the practice project. 

  2. Fork the repository to your GitHub account. 

  3. Clone the repository with Git on your computer.

  4. Use git log to look at the file structure and commits.  Note how, many commits, trees, and blobs there are.  Take a screenshot. 

  5. Create a new branch called "test," and checkout. 

  6. Use  git log  to look at your new branch. 

  7. Create a new file called  test.txt.

  8. Write “GitHub is awesome!” in your file, and save it using a text editor.

  9. Add and commit your new file to your branch. Take a screenshot. 

  10. Run a  git fetch  to see if any new files are on the main repo. Take a screenshot. 

  11. Use  git merge  to merge your branch to the master branch on your local repo.

  12. Get on the master branch as your working directory.

  13. Move the 2nd commit to a spot after the 4th commit. 

  14. Amend the commit message to “moved commit.”

  15. Squash the 2nd, 3rd, and 4th commit into one.

  16. Amend the commit message to “squashed 2,3,4.”

  17. Use  git reflog  to look at your work.  Take a screenshot

  18. Bonus (advanced): type in  gitk --all, screenshot the GUI graph of your repository, and commit it to your branch.

  19. Bonus (advanced): use the command  git log --graph --full-history --all , take a screenshot, and commit it to your branch. Push your branch to the remote repository and create a pull request. Take a screenshot.  

Check Your Work

Now, go through your screenshots and verify that all of the following is present:

  • The first screenshot shows the file structure and commits of the project underneath the git log command. 

  • The second screenshot shows the new file "test" is committed on a new branch (NOT the master branch). 

  • The third screenshot shows the git fetch command for the master branch on the remote repository. 

  • The fourth screenshot shows: 

    • The command  git reflog

    • The working directory is the master branch 

    • Interactive rebase has been used to change the 2nd commit to a spot after the 4th commit

    • Interactive rebase has been used to squash the 2nd, 3rd and 4th commit into one

    • The commit message has been changed to “squashed 2,3,4”

  • The fifth screenshot shows a pull request from the branch to the remote repository.  

All set?  Now you're ready for the end of part quiz!

Example of certificate of achievement
Example of certificate of achievement