Top Banner
$git some skills
27

Git Cards - Powerpoint Format

May 12, 2015

Download

Technology

Adam Lowe

Deck for studying up on Git commands.

This was purposefully kept free of any styling etc as this is the actual deck I use for memorization and don't like distractions.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Git Cards - Powerpoint Format

$git some skills

Page 2: Git Cards - Powerpoint Format

git initInitialize a new git repo in the current working directory.

Page 3: Git Cards - Powerpoint Format

git clone <clone_url>

Clone an existing git repo.

Page 4: Git Cards - Powerpoint Format

git logShow history of changes.

Page 5: Git Cards - Powerpoint Format

git diffShow changes to tracked files.

Page 6: Git Cards - Powerpoint Format

git statusShow a list of changed files in the working directory.

Page 7: Git Cards - Powerpoint Format

git add <path/file>

Add a new file to the current repo.

Page 8: Git Cards - Powerpoint Format

git add .Stage all new files and changes to tracked files for the current repo.

Page 9: Git Cards - Powerpoint Format

git add -uStage all removed files and changes to tracked files for the current repo.

Page 10: Git Cards - Powerpoint Format

git add -AStage all added files, removed files and changes to tracked files for the current repo.

Page 11: Git Cards - Powerpoint Format

git commit -aCommit all your local changes.

Page 12: Git Cards - Powerpoint Format

git commit --amendAmend your most recent commit with the current changes.

Page 13: Git Cards - Powerpoint Format

git tag v1.0Mark a version or milestone.

Page 14: Git Cards - Powerpoint Format

git pull --rebaseFetch from origin and fast forward your changes on top of it.

Page 15: Git Cards - Powerpoint Format

git pushPush committed to changes to origin.

Page 16: Git Cards - Powerpoint Format

git reset --hardDiscard all uncommitted changes in your working tree. Cannot be undone.

Page 17: Git Cards - Powerpoint Format

git checkout <path/file>

Reset an individual file back to HEAD.

Page 18: Git Cards - Powerpoint Format

git checkout <branch_name>

Switch branches.

Page 19: Git Cards - Powerpoint Format

git branchList all local branches for the current repo.

Page 20: Git Cards - Powerpoint Format

git branch -rList all remote branches for the current repo.

Page 21: Git Cards - Powerpoint Format

git branch -d <branch>

Delete a local branch.

Page 22: Git Cards - Powerpoint Format

git push origin :<branch_name>

Delete a remote branch.

Page 23: Git Cards - Powerpoint Format

git checkout branch2git merge branch1

Merge branch1 into branch2

Page 24: Git Cards - Powerpoint Format

git checkout -b new_branch old_branch

Create new_branch based on old_branch and switch to it.

Page 25: Git Cards - Powerpoint Format

git push origin

Push locally created branch to a remote.

Page 26: Git Cards - Powerpoint Format

git stash

Stash uncommitted changes in current working tree.

Page 27: Git Cards - Powerpoint Format

git stash pop

Apply stashed changes to current working tree.