[Git] 명령어 정리

장여진·2022년 3월 14일
0

Git

목록 보기
1/1

git 설정 관련 명령어

git config --global user.name "계정명"
-> git 계정명 등록
git config --global user.email "계정이메일"
-> git 계정이메일 등록
git config --list
-> git 설정정보 조회
git config --global core.editor 에디터종류
-> git editor 변경
git config --global core.autocrlf true

-> git add 명령어 사용시 아래 error발생할 때 사용하면 해결가능한 명령어
-> (LF will be replaced by CRLF in ~~~.The file will have its original line endings in your working directory)

git 등록 관련 명령어

git init
-> 현재 디렉토리를 git local repository로 지정(.git: repository)
git add 파일명
-> 해당 파일을 [staging area]에 추가
git add .
-> 모든 파일을 [staging area]에 추가
git commit
-> [staging area]에 있는 파일을 [repository]에 추가
git commit -m "커밋메세지"
-> 커밋메세지로 [staging area]에 있는 파일을 [repository]에 추가
git status
-> 파일 상태 확인(변경된 파일, staging area의 파일 등)
git log
-> commit했던 기록 확인

github 관련 명령어

git remote
-> git 원격저장소[repository]목록 확인
git remote -v
-> git [repository]이름, [repository]URL 확인
git remote add origin 저장소URL
-> git [repository]이름, [repository]URL 추가
git push origin master
-> 로컬 저장소에 commit한 내용을 원격저장소에 업로드


공부하며 작성하고 있는 블로그입니다.
잘못된 내용이 있을 수 있으며 혹시 있다면 댓글 달아주시면 감사하겠습니다 😊

0개의 댓글