Git 명령어

아현·2022년 5월 16일
0

개발환경

목록 보기
7/11



mkdir 폴더명 : 폴더 만들기

git init . : 해당 폴더에 git을 만든다

get log : version들을 보내준다

git status : 수정된 걸 알려서 바로 보여준다

git commit -am "Message 10" : version 추가

git push : 업로드

cat.파일명 : 파일의 내용을 보여준다

git status : 상태는 어때?

git add 파일명 : staging area에 올려준다

git commit -m "Message1" : staging area에 있는 파일을 repository에 version을 만든다

git status, git log로 확인가능

git branch : 현재 사용하고 있는 branch

git branch exp : exp라는 branch를 만든다(현재 속해있는 branch의 상태를 복사)

git checkout exp : checkout하고 exp로 들어가서 exp라는 branch를 사용한다

git log --branches --decorate : branch 비교

git log --branches --decorate --graph : branch가 더 잘 비교

git log --branches --decorate --graph--oneline : branch 간결하게 표현

stree (sourcetree라는 GUI 프로그램)

git log master..exp : master에는 없고 exp에 있는 것

git diff master..exp : 각각의 branch의 현재 상태(master에 없는데 exp에 있는 것)

git merge exp : exp를 master로 병합(현재 master로 branch되어 있어야함 - check master)

git branch -d exp (git checkout master 해놓고): exp branch 삭제



원격 브랜치 삭제

git push origin --delete main


원격 환경 받아오기

git remote update

profile
For the sake of someone who studies computer science

0개의 댓글