SpringBoot properties 파일과 https 인증서 gitignore 설정

SpringBoot 개발시에 properties에 db url과 password, https 인증서 비밀번호 기타등등 중요한 정보들이 들어있다.

이것을 깃에 올리면 보안상 안좋기에 커밋할때 안올려지게끔 설정을 해보자.

 

1. github에 올라간 파일 삭제

우선 자료를 먼저 백업 해두자.

git rm src/main/resources/application.properties // properties 파일 삭제
git rm -r src/main/resources/static/,well-known // https 관련 폴더 삭제
git rm src/main/resources/static/keystore.p12 // https 관련 파일 삭제

터미널에서 이 명령어를 입력하면 파일이 지워져있다.

 

2. .gitignore 수정

 

우선 .gitignore 파일이 있을거다

없다면 최상단에 생성을 해주자.

/.gitignore

이 파일에 들어가서

이렇게 적어주면 앞으로 깃 커밋할때 적용이 안된다.

 

그리고 커밋하면 완성~!

댓글

Designed by JB FACTORY