백앤드 개발/git (3) 썸네일형 리스트형 [GIT] GitHub 저장소 특정 파일의 커밋 기록 제거 1. 문제 .gitignore 가 반영이 되지 않은 채로 민감정보가 포함된 application-db.properties 가 push 됐다. 커밋 기록은 그대로 두고 application-db.properties 의 커밋 기록만을 제거하고 싶었다. 2. 해결방법 다음과 같이 Git 에 내장된 filter-branch 로 데이터를 삭제할 수 있다. # 불필요한 파일과 커밋 제거 $ git filter-branch -f --index-filter "git rm --cached --ignore-unmatch [파일경로/파일명]" --prune-empty -- --all # 원격 저장소 push $ git push --force --all 경로가 포함된 예시 $ git filter-branch -f --inde.. [GIT] remote: Invalid username or password. 1. 문제 로컬에서 원격 저장소 주소 추가 후 push 하는 과정에서 다음과 같은 메시지가 떴다. "remote: Invalid username or password." $ D:\dev\workspace_java>git remote add origin [원격 repository 주소] $ D:\dev\workspace_java>git push origin master remote: Invalid username or password. fatal: Authentication failed for [원격 repository 주소] 2. 해결방법 1) Github 토큰 재생성 Git hub 우측 메인 메뉴 > Settings > 좌측 메뉴 Developer settings> Personal access toke.. [GIT] 기본 명령어 1. 기본 명령어 $ git init: git 시작 $ git remote add origin {remote 주소}: 로컬 저장소, 원격 저장소 연동 $ git clone {remote 주소}: 원격 저장소 > 로컬로 복사 $ git add .: 변경사항 추가 $ git status: add 이력 확인 $ git commit -m '{커밋 메시지}': 커밋 메시지와 커밋 $ git push origin master: 원격 저장소 업로드 (origin > master) 2. .gitignore 적용 $ git rm -r --cached . : 캐시 제거. push 이전에 적용할 것 $ git add . $ git commit -m '{커밋 메시지}' 3. branch 관련 $ git branch: bran.. 이전 1 다음