Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 2.2 KB

File metadata and controls

52 lines (31 loc) · 2.2 KB

Git and GitHub tutorial

Last updated for remote use by D. Carr - May 2021

1. Go here if you need a GitHub account or must install Git.

2. Configure Git.

Windows users should start git by starting the "Git Bash" program, while Mac users should just be able to open up a normal terminal. On your machine, run these git config commands below (in any directory) to set your name, email, and preferred options.

Examples:

git config --global user.name “Sheila Kannappan”
git config --global user.email sheila@physics.unc.edu
git config --global color.ui "auto"
git config --global core.autocrlf false

Note user.name is not your GitHub username but rather your name.

(Our git tutorial assumes you will use nano as your editor. If you accidentally have another text editor, such as vi, set as your default and would like to switch to use nano, you can use the command git config --global core.editor "nano".)

You can check what you’ve done with

git config --list

Press q to quit out of the above command. You can get more details on config option by typing

git config -h        # short version
git config --help    # long version

3. Complete the tutorial below.

Table of Contents

  1. Automated Version control
  2. Creating a repository
  3. Tracking changes
  4. Exploring history
  5. Working with branches
  6. Setting up a remote repository in GitHub
  7. Collaborating

Source

This tutorial borrows heavily from Software Carpentry's tutorial Version control with git and Software Carpentry's branching tutorial from erdavenport, both under a Creative Commons Attribution license (CC BY 4.0)

4. Additional Resources

  1. Git cheat sheet
  2. Quick overview