cd "/directory_path" # change directory
pwd # print working directory
ls # list
ls -l # list one file per line. Avoid '\n' with -q or -b
ls -l -a # -a, --all do not ignore entries starting with .
touch text.txt # make new file
mkdir "디렉토리 명칭" # make directory
git init # create .git file -> initialize
git status # git 상태 확인
# git의 config 추가 또는 변경
# --global 옵션을 붙일 경우 local 환경 전체에 적용된다.
git config --global user.email "email"
git config --global user.name "name"
# git 하위 폴더에 변경사항이 있는 경우
git add "git의 버전으로 관리할 파일 추가" # staged 상태로 추가
git commit -m "커밋에 들어갈 메세지" # 현재 버전을 local git repo 저장소에 저장
git log [--oneline] # git에 commited 된 버전 로그 기록 확인 -> 정확하게는 HEAD까지의 commit을 표기한다.
# git remote(원격 저장소)가 설정이 되어 있지 않은 경우
git remote origin "git-remote-url"
# git remote에 현재 변경된 버전 업데이트
# origin(나의 github 원격 저장소), master(브랜치 명칭)
git push origin master

git checkout을 통해 HEAD 이 가리키는 내용을 바꿀 수 있다.대출과 같은 의미로 git repository에 있는 기존 버전 내용을 가져와 현재 버전(HEAD)으로 설정하는 명령어이다.detached 상태가 되므로, 최신 상태로 돌아오기 위해서는 git checkout master 명령어를 이용하는 것이 좋다.Rebase를 많이 쓰고 test를 진행할때는 branch를 따로 만들어 작업한다.