Skip to content

UNC-Libraries-data/Intro-to-Git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Intro to Git Workshop: Home

Intro to Git: Description

This guide provides additional resources to supplement the hands-on Intro to Git Workshop offered at the UNC Libraries: learn how to use Git, one of the most popular version control systems in the world. You don't have to be a developer to git started!

The last workshop was taught on Wednesday, October 3, 2018 at Davis Library Research Hub.

Prerequisites:

  1. Download and install the latest version of Git

  2. Create a free GitHub account

Slides:

Basic Git Commands Cheatsheet

Setting up Git

$ git config --global user.name "Mona Lisa"

Sets your username in Git; can be different than GitHub username

$ git config --global user.email "example@example.com"

Sets your email address in Git; should be same as GitHub email address so GitHub can associate your commits with your account

Creating Git Repositories

$ git init

Turns any folder into a Git repository

$ git clone https://github.com/username/repo-name.git

Copies an existing repository to your computer

$ git remote add origin https://github.com/username/repo-name.git

Links your local repository with your remote repository

Making Changes

$ git status

Returns status of changed files in your git repository

$ git add index.md

Adds changes made to a given file or set of files (index.md in this example) to your staging area

$ git commit -m "Add index.md"

Saves a snapshot of changes with a summary message

$ git push origin master

Syncs commits from your local repository up to your remote repository

$ git log

Returns list of local commits, or a history of saved snapshots

$ git pull origin master

Syncs commits from your remote repository down to your local repository

Bonus

$ git diff

View unstaged changes made to all files in your git repository

$ git remote add upstream https://github.com/original-owner/original-repo-name.git && git pull upstream master

Syncs your forked repository to the original repository. For more information, see GitHub's Configuring a remote for a fork.

Other Resources

More Tutorials:

Tools:

  • SourceTree: a free Git GUI that offers a visual representation of your repositories without having to use the command line

Other Resources:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published