An open API service indexing awesome lists of open source software.

https://github.com/twostoryrobot/workshop-git

A workshop for learning git
https://github.com/twostoryrobot/workshop-git

git workshop

Last synced: 6 months ago
JSON representation

A workshop for learning git

Awesome Lists containing this project

README

          

# 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.