Git + GitHub

git is a command-line tool, and GitHub is a company built on the underlying git technology. git is the open-source library (that can be found here: https://github.com/git/git). Git allows you to return to previous versions of a codebase, allowing many engineers to collaborate on a codebase without "breaking" each others work. You can think of it like a fancy file + folder system for code. Around ~75% of companies use GitHub + Git is their primary version control system. Alternatives to Git + GitHub are: SVN, Gerrit, AWS CodeCommit.

Roles that should know Roles that are nice to know
DevOps, Cloud Engineers, Backend Engineer, Frontend Engineer Support / Helpdesk, Quality Assurance Engineer

Key Concepts

  1. Branches + Pull Requests (GitHub)
  2. Commits ("Save") + Tags (Version)
  3. "Branch Strategy" (see: GitHub Flow + Basic Flow)

Exercise 1: Learning the git basics

What you'll learn

Install Git + begin to explore the following commands in a Linux environment. If you need a Linux environment, you can use the Open Cloud Dev Box.

The basic way of using git

  1. git add file.txt => Tells git to prepare to be committed.
  2. git commit -m "a message" => Saves the change.
  3. git push => Syncs the change with GitHub.

Useful commands

  • git status => This is "home base" on your current state.
  • git push --set-upstream origin garcia-adding-search-feature => Pushes a local branch to remote GitHub.

Example Scenario

  1. You are an employee asked to "make a website for clothing".
  2. Go and create the clothing website repo.
  3. Your first task is to create a "homepage".
  4. Create a branch for your new task and add a homepage.txt.
  5. Push the changes and open a pull request.
  6. Comment your own pull request as your "colleague", who asks you to add an image to the homepage.
  7. Add a file "image.txt" and update the "homepage.txt" content.
  8. Commit and push this change.
  9. Review your pull request.
  10. Approve the pull request.
  11. Merge the pull request.

Repeat the above until you feel comfortable!

results matching ""

    No results matching ""