1.8 Utilize common version control operations with Git

I enjoyed reading the OCG’s Git section in chapter 2. As I read the chapter, I created a list of 39 Git tasks. I ran through this list backward and forwards in Terminal.

Here are 12 of them:
  1. Clone existing repository?
  2. Create a new repository?
  3. Include files for Git to track.
  4. Remove files from the directory via BASH.
  5. Delete the working directory.
  6. Move or rename a file.
  7. Use the commit command.
  8. Add a remote repository.
  9. See which remote repository has been configured.
  10. Remove remote tracking.
  11. Use a remote repository after creating a new repository.
  12. Sync your local repository to the remote repository.

My Favorite Git Tutorial

Git-It referenced by GitHub. It’s a free hands-on tutorial you download onto your computer. It has been my favorite way of practicing various Git commands with real repositories. I also practiced using BASH commands while going through this tutorial.

For example:
  • $ cd (change directory)
  • $ echo (add text to a file)
  • $ touch (create a new file)
  • $ mkdir (create a new directory)
  • $ rm (delete a file or directory)
  • $ cat (display contents of a file)
  • $ move (move a file or folder OR rename a file or folder)
  • $ pwd (view current working directory path)

New to Git? Start Here

My Favorite Git Commands

#create a new directory or folder and initialize it at the same time
$ git init <directory path>
#check the status of your local repo
$ git status
#see what changes your co-developers made before merging them to your local repo
$ git fetch
#view what commits have been made
$ git log main..origin/main
#view local repo branches
$ git branch
#view remote repo branches
$ git branch -r

Resources Used

1 Git
Chapter 2 in the Official Cert Guide (OCG) for DEVASC, contains a Git section. I read all of Chapter 2 first before I even started practicing any Git commands. https://www.ciscopress.com/store/cisco-certified-devnet-associate-devasc-200-901-official-9780136642961

2 A Brief Introduction to Git
This is a free walk-through module on the Cisco DevNet site.  Learn what Version Control Systems are, basic Git workflows, and start working with sample code examples. https://developer.cisco.com/learning/modules/intro-python/git-basic-workflows/step/1

3 Learn Git in 30 minutes
In less than an hour, learn how to install Git, Configure Git, and start working with Git. It’s free and provides a great starting point. https://tutorialzine.com/2016/06/learn-git-in-30-minutes

4 Various Git Resources
A free super in-depth look at Git from the official Git website. https://git-scm.com/book/en/v2

5 Use Git for Version Control
CBT Nuggets is my online video training of choice. It fits the way I learn and doesn’t break the bank. After going through the above resources, I watched their videos covering Git. https://www.cbtnuggets.com/it-training/cisco/devnet-associate

6 Collaborate with Git
This is a video from CBT Nuggets as well. By this point, Git and I are well acquainted. Watching the videos last helps established what I already learned at this point. https://www.cbtnuggets.com/it-training/cisco/devnet-associate