Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 2.23 KB

File metadata and controls

51 lines (32 loc) · 2.23 KB

Git and GitHub tutorial

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

2. Configure Git.

On your linux machine, run git config (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
git config --global core.editor vi

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

(Our git tutorial assumes you will use vi as your editor, but if you wish to use emacs or some other plain text editor as your default, just type `git config --global core.editor "emacs"' or the analogous command.)

You can check what you’ve done with

git config --list

You can get more details on config option by typing

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

On your laptop, run git config with the same answers used above for your linux machine (to get a terminal, under Windows go to start menu and type "gitbash" to search, or under Mac go to spotlight and type "terminal" to search).

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