Skip to content

TwoStoryRobot/workshop-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Git Workshop

This is a simple introduction to git and github. We'll be making several branches and commits to files in this very repository. Everything will be in markdown, so you won't need to know any specific language (other than markdown obviously).

Let's learn some git!

NOTE Some of this is probably going to seem incomplete. You are going to help build this workshop! You'll see WIP scattered about. That just means the section is Work In Progress.

Communication

Git (and github) is not just a tool for version control. It's also a communication tool. We should strive to be excellent communicators. We are going to practice communicating here in this workshop.

Forks

WIP

Just like a fork in a path, a repository fork is the start of a new bit of code but it shares the same history as the original code base.

  1. Fork this repository
  2. Clone it to your local machine

Repositories

WIP

Repositories are where your code physically resides. Local, remote, on your computer, in Github.

Question: Name all the repositories that share a common history with this code base

Branches

WIP

Branches are kind of like forks, but they are contained withn a repository. Branches are cheap, so we want to use them often.

WIP When should we branch?

Let's add some files that link to other great programming resources on the web.

TODO: Add commands to branch here

  1. Create a new branch
  2. Make a new file

Commits

WIP

Commits are little saved change to a repository. They also communicate to your fellow teammates and your future self.

  1. Add an interesting resource to your file.
  2. Commit that change.
  3. Add a link to your file from this README file
  4. Commit that change.
  5. Now edit the file and add some things to the top and bottom of the file
  6. Commit only the changes to the bottom of the file

Note: Use good communication skills.

Question: What are some examples of good commit messages?

TODO: Discuss the different ways to git add

Pull Requests

WIP

Pull requests are when you request that someone pull in your changes to a repository. Sometimes they are called merge requests (depending on the provider you are using)

  1. Push your changes to your fork
  2. Make a pull request (remember to use good communication)
  3. See if someone will merge it in.

Keeping up to date

Question: Think about the changes you just made. Where are they?

WIP Remotes are just remote repositories. Git keeps these handy for you so you can easily get code from different repositories.

  1. Add this repository as upstream
  2. Pull the upstream changes.

Question: What's the difference between fetch and pull?

WIP How to track upstream? When to push/pull?

Github Issues

WIP

Keep track of your things to do.

History

Git keeps a history of all changes ever made.

Question: Why would this be helpful?

Use the CLI, figure out what my cat's name is. Hint: This file originally contained my cat's name.

About

A workshop for learning git

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published