Git
[Git] config, ignore
qoth_0
2023. 12. 11. 09:48
728x90
반응형
git 설정정보 조회
- git config --list
- 특정 repo안에서 조회하면 특정 repo에 대한 지역정보가 조회되고, repository밖에서 조회 시 전역 정보 조회

user.name, user.email이 잘 들어가야 commit이 됨
github 사용자 지정
- 사용자 지정은 사용자 인증과 상관없이 자유롭게 가능
- commit 사용자 이름과 email지정
- 전역적 선언 : .git 폴더가 없을 때 기본으로 적용
- git config --global user.name “qoth-0”
- git config --global user.email “bny1324@naver.com”
- 홈 디렉토리 .gitconfig에 저장
- 지역적 선언 : 해당 레포의 설정
- git config --local 로 설정
- .git/config에 저장
git config —list로 보면 맨 아래에 적용됨
이대로 add, commit, push하면 해당 사용자의 이름으로 commit 됨
.git config파일

로컬 레포에서 숨김파일을 확인해보면 .git이 있다

그안에 config 파일을 확인해보자

여기서 romote “origin”의 url을 내 주소로 바꾸면 내 레포지토리로 올릴 수 있다.
git ignore
- git에서 추적목록에서 제외할 대상 나열
- ignore 파일 생성방법
- 템플릿을 통한 ignore파일 생성

→ 깃 레포생성 시 설정 가능
- spring boot initializer와 같은 패키지 툴을 통해 생성시 ignore파일 자동 생성 지원 ex) HELP.md .gradle build/

728x90
반응형