git-basic-commands

INIT

Make a arepository

mkdir git_toturial
cd git_toturial
git init

이미지

ADD & COMMIT

touch index.html
vi index.html
git add index.html
git commit index.html -m “init”

이미지

vi index.html
touch readme.md
git add index.html readme.md
git commit index.html readme.md -m “second”

이미지

WORKING DIRECTORY/INDEX(Staging Area)/REPOSITORY

complex..

이미지

simple image

이미지

in Git bash

이미지

DISCARD

이미지

RESET

이미지

REVERT

reverse commit

touch revert.md

  • revert. This command creates a new commit that undoes the changes from a previous commit
  • reset. it changes which commit a branch head is currently pointing at

이미지