본문 바로가기

개발/협업

gitignore 파일 수정 후 해야하는 작업 gitignore 파일 수정 후 gitignore에 추가/삭제 된 파일을 git에도 반영시키고 싶다면 아래의 한줄짜리 코드를 복사해서 붙여넣으면 반영이 된다. git rm -r --cached . && git add . && git commit -m "fixed untracked files"단, 이미 서버에 올라 간 파일들의 history는 변함이 없음을 유의하자.
git 특정파일 변경사항 되돌리기 개발하다보면 특정파일의 변경사항을 가장 마지막의 commit 버전으로 되돌려야하는 경우가 생깁니다. 0. 현재 상황 아래는 현재의 변경사항이 일어난 파일 목록입니다. $ git status On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: Dockerfile modified: docker-compose.yml Untracked files: (use "gi..
Git 원본 저장소와 fork한 저장소 동기화 1. 원본 저장소의 원격 주소를 로컬 저장소에 추가 $ git remote add upstream git@github.com:ORIGINAL_OWNER/ORIGINAL_REPO 위에 주소에서 원격 주소 부분은 본인이 동기화 할 원본 저장소의 주소를 사용한다. 2. 정상 추가되었는지 확인 $ git remote -v origin https://github.com/MY_NAME/MY_FORKED_REPO.git (fetch) origin https://github.com/MY_NAME/MY_FORKED_REPO.git (push) upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) upstream https://github.c..