Git

Git 명령어

tjddneva 2022. 3. 6. 22:04

자주 쓰는 Git 명령어를 모아보자!

명령어 설명은 천천히 추가하자!

 

git init
git clone [remote_repository address] [directory_name]
git status
git add
git commit -m -a --amend
git log -stat -p 
git diff

git reset --hard --soft --mixed [version]   
git revert [version]

git branch [branch_name]

git branch -r : 원격저장소 branch 리스트 보기

git checkout [branch_name] 

git checkout -t [원격저장소 branch 이름] : 로컬의 동일한 이름의 branch를 생성하면서 해당 branch로 체크아웃

git merge [branch_name]

git remote add origin [remote repository address]
git push pull fetch --allow-unrelated-histories

 

git rm -r --cached test : git 으로 관리하고 있던 test 폴더와 그 하위내용들을(-r recursive 옵션) 관리대상에서 제외한다