Skip to main content

GIT - cheat sheet

Install (Windows)

https://git-scm.com/

https://desktop.github.com/

set up new repo

(create git repo in web gui first)

git init
git add .gitignore
touch README.md
git add README.md
git remote add myOrigin git@github.com:maxbis/examengesprekken
git push -u origin master

ssh key

add ~/.ssh/id_rsa.pub in git hub web gui

add file

git add <file name>

update repo

git commit -a -m "comment"
git push

Get updated files

git pull

Overwrite local changes

git reset --hard
git pull

New clone - install new

git clone https://github.com/maxbis/examengesprekken

// for Ubuntu server
sudo chgrp -R www-data examengesprekken

Go to older version

git reset --hard 0ad5a7a6.....

Git clear cache (if ignore file is changed)

git rm --cached config