Finish Git, Github




CS174

Chris Pollett

Oct 26, 2016

Outline

Committing changes

On Monday, we introduced Git as a version control system for our projects. Today, we continue to look at how to manage versions of a project in git.

Branches, Merging Branches

Example resolving conflicts

Making patches

Let's Experiment

  1. If you don't already have Git, you can download it from https://git-scm.com/.
  2. For this let's experiment, create a fresh git repository in a folder my_fresh_repo. Make a file test.txt with the letter a in it.
  3. Add this file to your repository and make an initial commit.
  4. Do the following three times: Reopen the file add to the end of it, the letter a. Commit this change.
  5. Make a patch from your second commit to HEAD, and post it as your solution to the Oct 26 Let's Experiment Therad.

Git Tags

Issue Tracking

GitHub

Getting started with GitHub

GitHub Work Flows

GitHub Work Details -- Getting a copy

  • In details what happening, is clicking fork gives you a copy in your user account space of that repository. For example, the original repository might have been:
    https://github.com/ORIGINAL_USERNAME/PROJECT.git
    your fork wil be
    https://github.com/YOUR_USERNAME/PROJECT.git
  • To get a copy on your laptop of your fork, you just clone that address:
    git clone https://github.com/YOUR_USERNAME/PROJECT.git
    
  • To make sure you can stay in sync with the original repository we need to add an upstream source for our clone:
    git remote add upstream https://github.com/ORIGINAL_USERNAME/PROJECT.git
    
  • GitHub Work Details -- Working locally, Synchronization, Pull Requests