Show Menu
Cheatography

first steps in git Cheat Sheet (DRAFT) by [deleted]

minimal git knowledge

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Starting a Repository

git clone address foldername
Get a local copy of the reposi­tory, save it in folder
git init .
Create a local repository in current folder
 

Adding Stuff

git add filename
stage a file = add it to the index = prepare it for the next commit
git commit -m 'log message'
create a commit = save all the staged changes in the local repository
git push
copy all the local commits to the central repository
 

Checking the Status

git status
shows the status, see examples below
Changes to be committed: (filenames in green)
shows all the stuff that will be in the next commit
Changes not staged for commit: (filenames in red)
shows other modified files, that have not been added=­staged yet
git log --oneline
shows all the commits, one line per commit