시스템의 모든 사용자와 모든 저장소에 적용
git config --system
시스템의 특정 사용자에게 적용
git config --global
특정 저장소에 적용
git config --local
git config user.name <user_name>
git config user.email <email_address>
git config core.autocrlf
📌 참고 CRLF
• 쉽게 말해 줄바꿈 문자를 말한다.
• Windows 에서는 CR (\r) + LF (\n) 모두 사용
❗주의
서로 다른 OS 에서 함께 Git 으로 작업한다면
core.autocrlf = ture 사용
• core.autocrlf = false 파일에 적용된 줄바꿈 문자와 상관없이 작업한 환경의 줄바꿈 문자를 적용한다.
• core.autocrlf = true 파일에 적용된 줄바꿈 문자를 CRLF 에서 LF 로 변경한다.
• core.autocrlf = input Commit 할때만 CRLF 를 LF 로 변경한다.
git config core.editor <editor_name>
git config init.defaultBranch <branch_name>
git config —l
git config —list
git config —l —show-origin
git config —list — show-origin
git config
git config -help
ex) git config --global --unset user.mail
git config --global --unset core.autocrlf
git init
❗오류 메세지
fatal: not in a git directory
↪️ 범위설정을 안해줬더니 이게 어디 들어가야할지 로컬 설정할 환경이 아니라는 뜻permission denied
↪️ 오류가 뜨면 대부분 권한이 안되어 있으므로 관리자권한으로 다시 열기
• Repository 는 Git 으로 관리하는 프로젝트 저장소
• 파일과 디렉토리가 포함될 수 있고, 버전관리를 시작할 수 있다.
• Local Repository - 사용자의 컴퓨터의 저장소
• Remote Repository - 원격서버의 저장소
Git Init
- 아직 버전관리를 하지않는 프로젝트 폴더를 Git 저장소로
만들 수 있다.- 최초의 프로젝트 관련된 파일을 몇개 만들고 시작을 할때,
git이 관리하는 Repository 만들고 remote 서버에다가 공유하는 방식- 이미 특정 폴더가 존재하는데 이 폴더를 레파지토리로 만들고 싶을 때
- ↪️ 폴더를 만든 다음에 반드시
폴더 안으로 들어와서 git init을 실행 해줘야한다.
그럼 이 폴더가 git 레파지토리가 된다.
Git Clone
- Remote 저장소를 Local 에 복사하여 사용할 수 있다.
- 이미 리모트에 레파지토리가 있는 상태에서 로컬로 복제해서 사용하는 방식
git init
https://github.com//<project_name>.git
https://github.com/<user_name>/<project_name>.git
git clone <remote_repository_url>
git clone https://github.com//<project_name>.git
git clone https://@github.com/<user_name>/<project_name>.git
목록보기(window 기준)
- ls ➡️ dir /b
모든 목록보기
- ls -all ➡️ dir /a
삭제
- rm ➡️ del
텍스트 편집기
- vi config ➡️ notepad config
현재 작업 중인 디렉토리의 경로를 출력
- pwd ➡️ cd