# 초기작업 git init touch a git add . git commit -m "C0" vim a - c1 작업 git add . git commit -m "C1" # reset 방법 git reset HEAD^ vim a - c1 작업완료 git add . git commit -m "C1 new" # amend 방법 vim a - c1 작업완료 git add . git commit --amend # 새 커밋 메세지를 입력하는 vi 창에서 새 커밋 메세지 입력 현재 이 상황에서 C1을 무르고 C0을 돌아가고 싶은 경우 git reset 를 해주면 된다. 이 후 수정 작업을 진행할 수 있다. git reset이 아닌 git checkout -f 17348aa를 한다면 헤드는 기존 C1을 가르키고 m..
# git 저장소 생성 git init # c1 by master echo "aaa" >> 1.txt cat 1.txt git add .; git commit -m "c1" git log --oneline --all --decorate --graph # bugFix 브랜치 생성 및 이동 git checkout -b bugFix # c2 by bugFix echo "bbb" >> 1.txt cat 1.txt git add .; git commit -m "c2" git log --oneline --all --decorate --graph # c3 by bugFix vim 1.txt a 키 입력 aaa 를 kkk 로 수정 ESC 키 입력 :wq! 입력 git add .; git commit -m "c3" gi..
git init # C0 echo "안녕" >> 1.txt git add .;git commit -m "작업0" git log --all --graph --decorate --oneline # C1 echo "하세요." >> 1.txt git add .;git commit -m "작업1" git log --all --graph --decorate --oneline # C2 echo "반가워요!" >> 1.txt git add .;git commit -m "작업2" git log --all --graph --decorate --oneline # 최신커밋에서 뭔가를 하려다가, git add 하기 전에, 잠시 과거로 돌아감 echo "♥♥" >> 1.txt git checkout C1 # 실패, 기존 작업을 ..
https://learngitbranching.js.org/?locale=ko Learn Git Branching An interactive Git visualization tool to educate and challenge! learngitbranching.js.org rebase : 가지가 이사를 간다. git rebase --continue : 현재 c2의 가지가 이사를 갔다. (병합할 때 하나밖에 없기 때문에 자동으로 master 브런치로) # 폴더 초기화 rm -rf * rm -rf .git # git 생성 git init # c0 echo 1 > 1.txt cat 1.txt git add .; git commit -m "c0" git log --all --graph --decorate --o..
https://learngitbranching.js.org/?locale=ko Learn Git Branching An interactive Git visualization tool to educate and challenge! learngitbranching.js.org Learn Git Branching에 merge를 직접 폴더안에 파일을 만들어서 내용을 작성하고 커밋과 브랜치를 생성하여 실습 # 폴더 초기화 rm -rf * rm -rf .git # git 생성 .git # c0 echo 1 > 1.txt cat 1.txt git add .; git commit -m "c0" git log --all --graph --decorate --oneline # c1 vim 1.txt 키입력 : a 방향키 ..