Actual files you work on.
Working Directory
Workflow
Slide 29
Slide 29 text
Staging area.
Index
Workflow
Slide 30
Slide 30 text
Points to the last commit made.
HEAD
Workflow
Slide 31
Slide 31 text
New Repository
Slide 32
Slide 32 text
$ cd ~/Sites
Make a New Repo
Slide 33
Slide 33 text
$ mkdir
Make a New Repo
Slide 34
Slide 34 text
$ cd
Make a New Repo
Slide 35
Slide 35 text
$ git init
Make a New Repo
Slide 36
Slide 36 text
Clone Repository
Copies an existing repository
Slide 37
Slide 37 text
$ cd ~/Sites
Clone an Existing Repo
Slide 38
Slide 38 text
$ git clone https://github.com/
charlotte-front-end-developers/
git-tutorial.git
Clone an Existing Repo
Slide 39
Slide 39 text
$ cd git-tutorial
Clone an Existing Repo
Slide 40
Slide 40 text
Status Check
Slide 41
Slide 41 text
$ git status
Status Check
List all of the changes that have
been made but not committed.
Slide 42
Slide 42 text
Add Changes
Slide 43
Slide 43 text
$ git add .txt
Add Changes
Adds an individual file and stores them in the
Index until you’re ready to commit.
Slide 44
Slide 44 text
$ git add .
Add Changes
Add all changes.
Slide 45
Slide 45 text
Commit Changes
Slide 46
Slide 46 text
$ git commit -m “Message”
Commit Your Changes
Commits your changes and updates the HEAD.
Slide 47
Slide 47 text
Logs
Slide 48
Slide 48 text
$ git log
Logs
Lists the recent history of a repo.
Slide 49
Slide 49 text
$ git log --pretty=oneline
Logs
Lists the recent history of a repo in a slightly
more readable format.
Slide 50
Slide 50 text
$ git log --pretty=format:'%h %ad
| %s%d [%an]' --graph --date=short
Logs
Lists the recent history of a repo in
an extremely more readable format.
Slide 51
Slide 51 text
$ git log --graph --
pretty=format:'%Cred%h%Creset -
%C(yellow)%d%Creset %s
%Cgreen(%cr) %C(bold blue)<%an>
%Creset'--abbrev-commit --
date=relative
Logs
Lists the recent history of a repo in
an extremely more readable format.
Slide 52
Slide 52 text
Adding Remotes
Slide 53
Slide 53 text
$ git remote add origin
Adding Remotes
Useful for adding a remote to a new GIT repo.
Slide 54
Slide 54 text
$ git remote add
Adding Multiple Remotes
Creates another remote that
you can pull and push too.
Slide 55
Slide 55 text
Push Changes
Slide 56
Slide 56 text
$ git push origin master
Push Your Changes
Pushes your changes to the remote. Typically a
server or service like Github. Origin is an alias to
a URL. Master is simply the default branch.
Slide 57
Slide 57 text
Pulling Changes
Slide 58
Slide 58 text
$ git pull origin master
Pulling Changes
A pull is two GIT commands in one. It will fetch
changes from the remote, then attempt to
merge them into your local repo.
Slide 59
Slide 59 text
Branches
Slide 60
Slide 60 text
$ git checkout -b
Branches
Creates a new branch.
Slide 61
Slide 61 text
$ git branch
Branches
Lists all branches.
Slide 62
Slide 62 text
$ git checkout
Branches
Change to your newly created branch.
Slide 63
Slide 63 text
$ git checkout master
$ git merge
Branches
Merge a branch back into your master branch.
Slide 64
Slide 64 text
$ git push origin
Branches
Push your branch to the remote.
Slide 65
Slide 65 text
$ git branch -d
Branches
Delete a branch.
Slide 66
Slide 66 text
Revert Commits
Slide 67
Slide 67 text
$ git checkout --
Revert Commits
Undo your changes to an individual file.
Slide 68
Slide 68 text
$ git checkout
Revert Commits
Detach you from what’s in HEAD.
Slide 69
Slide 69 text
$ git checkout -b
Revert Commits
Detach you from what’s in HEAD
and create a new branch
Slide 70
Slide 70 text
$ git stash
$ git reset --hard
$ git stash pop
Revert Commits
Stash your current changes and then reset.