Cheatography
https://cheatography.com
Working Directory -> git add -> staging -> git commit -> local -> git push -> remote
Git StatusDisplays the state of the working directory and the staging area | Files in the working directory: | listed under "Changes not staged for commit" | Files in the staging area: | Listed under "Changes to be committed" | Files in the local repo: | Nothing to commit (working directory clean) |
|
Working Directory <-> StagingWorking Directory -> git add -> Staging | Working Directory <- git checkout/merge <- Staging | Working Directory <- git diff -> Staging |
Making changesAdd file to stage | git add fileName | Add all files to stage | git add . |
Evaluate changesdiff of what is changed but not staged | git diff -- |
BranchesList all branches | git branch | Add a branch | git branch NameOfNewBranch | Switch to specified branch in working directory | git checkout -- BranchName | Join specified [from name] branch into your current branch (the one you are on currently) | git merge -- fromName | show all commits in the current branch’s history | git log |
| | Staging <-> Local RepoStaging -> git commit -> Local Repo | Staging <- git reset <- Local Repo | Staging <- git diff --staged -> Local Repo |
Committing to remoteMove all staged files to git remote repo | git commit -m 'message' | Move all staged files to git remote repo | git commit -am 'message' |
Reverting changesUnstage a file while retaining the changes in working directory | git reset fileName | diff of what is staged but not yet commited | git diff --staged |
Start ProjectCreate Project | git init directoryName | Download remote repo | git cline ulrName |
| | local <-> remotelocal -> git push -> remote | local <- git pull/fetch <- remote |
Remote to localGit fetch | Bring down all branches from Git remote | Git pull | Fetch and merge commits from remote branch |
Local to remotegit push | Transmit local branch commits to the remote repository branch |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by datamansam