.git 파일 생성rm -r .gitgit add .git commit <파일명> -m "메시지"예시:
a와 b 파일을 git add 후:Changes to be committed:
modified: a
modified: ba 파일만 commit한 후:Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: bgit log <브랜치명>--oneline: 각 커밋을 한 줄로 표시 → git log --oneline--graph: 커밋 히스토리를 트리 형태로 표시 → git log --graph--author="이름": 특정 작성자의 커밋만 필터링 → git log --author="홍길동"--since="날짜": 지정한 날짜 이후 커밋 표시 → git log --since="2024-01-01"--until="날짜": 지정한 날짜 이전 커밋 표시 → git log --until="2024-11-01"-p: 각 커밋의 변경 내용을 표시 → git log -pgit init
git remote add origin <github 주소>
git branch -M main
git push -u origin main
git clone <github 주소> .
git pull
git add .
git commit -m "메시지"
git push origin <브랜치명>
git pull
git config pull.rebase false: Merge 방식 사용git config pull.rebase true: Rebase 방식 사용git config pull.ff only: Fast-Forward 병합만 허용git pull 실행 시 충돌 발생<<<<<<< HEAD (로컬 변경 사항)
======= (구분선)
>>>>>>> <해쉬값> (원격 변경 사항)git add .git commit -m "충돌 해결 메시지"git branch <브랜치이름>
git branch
q키를 눌러 빠져나올 수 있음.
git switch <브랜치이름>
또는
git checkout <브랜치이름>
git switch -c <브랜치이름>
또는
git checkout -b <브랜치이름>
git switch <(원격)브랜치명>git merge <(로컬)브랜치명>git add .
git commit -m "메시지"
git push origin <(로컬)브랜치명>git checkout main
git pull origin main
git pull origin dev