|
Displays 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 -> git add -> Staging
|
|
Working Directory <- git checkout/merge <- Staging
|
|
Working Directory <- git diff -> Staging
|
|
Add file to stage
|
git add fileName
|
|
Add all files to stage
|
git add .
|
|
Add changes in specific file
|
git add -p <file>
|
|
diff of what is changed but not staged
|
git diff --
|
|
List 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 -> git commit -> Local Repo
|
|
Staging <- git reset <- Local Repo
|
|
Staging <- git diff --staged -> Local Repo
|
|
Staging <- git checkout HEAD filename <- Local Repo
|
|
(git checkout HEAD filename command rolls back all changes that have been made to filename since the last commit)
|
|
Move all staged files to git remote repo
|
git commit -m 'message'
|
|
Move all staged files to git remote repo
|
git commit -am 'message'
|
|
Unstage a file while retaining the changes in working directory
|
git reset fileName
|
|
diff of what is staged but not yet commited
|
git diff --staged
|
|
Create Project
|
git init directoryName
|
|
Download remote repo
|
git cline ulrName
|
|
local -> git push -> remote
|
|
local <- git pull/fetch <- remote
|
|
Git fetch
|
Bring down all branches from Git remote
|
|
Git pull
|
Fetch and merge commits from remote branch
|
|
git push
|
Transmit local branch commits to the remote repository branch
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.