git config —global user.name “suyeon kang”
git config —global user.email “tndusrkd91@gmail.com”
git init
git remote add origin <repository>
git pull origin master
git add .
git commit -m “”comment”
git push origin master
git log
or git log —online
git status
git diff
git branch 'name'
git checkout 'name'
git merge —no-edit
text editor 열지 않기git merge 'new branch'
(in master branch)rebase
는 merge
와 비슷하지만 더 클린한 workflow history를 가질 수 있음
stash
는 작업을 임시적으로 어딘가에 저장함(일정 작업이 끝난후에 덮어쓰기 할 수 있음)
git rebase master
(in new branch)git stash save
Commit Message 수정
git commit --amend -m "New commit message"
git push origin branch --force
Commit Message 삭제
git reset --hard commitID
git push origin branch --force
--soft
: History changed, HEAD changed, Working directory is not changed.
reset --hard
: History changed, HEAD changed, Working directory is changed with lost data.
remote url 변경
git remote set-url origin <new_remote_url>
simpler version than convention
example
website
http://domain.com -> domain.com.git
http://sub.domain.com -> sub.domain.com.git
others
star-wars.git
the-empire-strikes-back.git
return-of-the-jedi.git