Git으로 파일 관리를 시작하기(Git 초기화)
Git 저장소 생성
git init
기본 브랜치 이름 변경
git config --global init.defaultBranch 변경할_브랜치_이름
현재 상태 확인
git status
전체 로그 확인
git log
Staging area로 파일 이동시키기
git add .
저장소 복제 및 다운로드
git clone ~~~~
파일을 Local repository에 저장하고 버전을 기록(commit)
git commit -m "message"
Remote repository로 업로드
git push origin master
원격 저장소의 변경 내용을 현재 디렉토리로 가져오기 (pull)
git pull
Remote repository와 Local repository를 연결
git remote --v
브랜치 삭제
git branch -d [브랜치명]
현재 브랜치에 다른 브랜치 수정사항 병합
git merge [다른 브랜치명]
복사할 코드가 있는 Rmote Repository의 코드를 내 Rmote Repository로 복사
Fork
상대의 Rmote Repository 주소를 내 Local Repository와 연결
git rmote add pair [상대의 Rmote Repository 주소]
연결된 주소들의 목록 확인
git rmote -v
파일 수정
nano [파일이름]
수정한 파일을 staging area에 추가 (commit 전)
git add [파일이름]
commit이 되지 않은 파일을 폐기
git restore [파일이름]
staged된 파일을 이전 상태로 되돌림
git restore --staged
'Development > Git' 카테고리의 다른 글
4일차 [Git] 기초 👋 (4/14) (0) | 2023.04.15 |
---|