Skip to content

Latest commit

 

History

History
63 lines (51 loc) · 1.69 KB

Git.md

File metadata and controls

63 lines (51 loc) · 1.69 KB

GIT CHEAT SHEET

Porcelain commands

CREATE REPOSITORIES

git init
Create a new local resository
git clone [url]
Download a project

TRACKING CHANGES

git add [file/folder]
Prepares the file or folder to commit
git status
Shows all modification to be committed
git commit -m "[message]"
Save changes at a point in time with a description
git reset [file/folder]
Remove the file or folder from staging area

WORKING WITH BRANCHES

git branch [new branch name]
Creates a new branch
git chechout [branch name]
Changes the current wokining directory branch
git merge [branch]
Performs the merge between the current branch and the branch passed as argument
git rebase [branch]
Performs the merge, but recreate the history in a only branch and destroys the other

TEAM WORK

git push
Uploads all local branch chanches to origin
git fetch
Downloads all origin branch changes locally
git pull
Performs a git fetch and git merge

Plumbing commands

git cat-file -p [hash object]
Shows friendly informations about a git object
echo 'Git Cheat Sheet' | git hash-object --stdin
Calculate the SHA1 of 'Git Cheat Sheet'
git count-ojects
Shows number of git objects
git show-ref [branch]
Shows commit references for a branch