git cards - keynote format

27
$git some skills

Upload: adam-lowe

Post on 12-May-2015

1.365 views

Category:

Technology


1 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Git Cards - Keynote Format

$git some skills

Page 2: Git Cards - Keynote Format

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

Page 3: Git Cards - Keynote Format

git clone <clone_url>

Clone an existing git repo.

Page 4: Git Cards - Keynote Format

git logShow history of changes.

Page 5: Git Cards - Keynote Format

git diffShow changes to tracked files.

Page 6: Git Cards - Keynote Format

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

Page 7: Git Cards - Keynote Format

git add <path/file>

Add a new file to the current repo.

Page 8: Git Cards - Keynote Format

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

Page 9: Git Cards - Keynote Format

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

Page 10: Git Cards - Keynote Format

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

Page 11: Git Cards - Keynote Format

git commit -aCommit all your local changes.

Page 12: Git Cards - Keynote Format

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

Page 13: Git Cards - Keynote Format

git tag v1.0Mark a version or milestone.

Page 14: Git Cards - Keynote Format

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

Page 15: Git Cards - Keynote Format

git pushPush committed to changes to origin.

Page 16: Git Cards - Keynote Format

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

Page 17: Git Cards - Keynote Format

git checkout <path/file>

Reset an individual file back to HEAD.

Page 18: Git Cards - Keynote Format

git checkout <branch_name>

Switch branches.

Page 19: Git Cards - Keynote Format

git branchList all local branches for the current repo.

Page 20: Git Cards - Keynote Format

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

Page 21: Git Cards - Keynote Format

git branch -d <branch>

Delete a local branch.

Page 22: Git Cards - Keynote Format

git push origin :<branch_name>

Delete a remote branch.

Page 23: Git Cards - Keynote Format

git checkout branch2git merge branch1

Merge branch1 into branch2

Page 24: Git Cards - Keynote Format

git checkout -b new_branch old_branch

Create new_branch based on old_branch and switch to it.

Page 25: Git Cards - Keynote Format

git push origin

Push locally created branch to a remote.

Page 26: Git Cards - Keynote Format

git stash

Stash uncommitted changes in current working tree.

Page 27: Git Cards - Keynote Format

git stash pop

Apply stashed changes to current working tree.