Home Git Command & Git Ignore - 1
Post
Cancel

Git Command & Git Ignore - 1

Password 저장

1
2
3
git config --global credential.helper store
### 한 번 git pull을 해주면서 비밀번호를 입력하면 저장된다
git pull

Git 에러 warning: LF will be replaced by CRLF 해결방법

1
2
### core.autocrlf 기능 꺼주기
git config --global core.autocrlf false

Git 에러 bad signature index file corrupt 해결방법

1
2
rm -f .git/index
git reset

특정 폴더나 파일 무시하기(.GITIGNORE)

1
2
3
4
5
6
7
8
9
10
11
12
13
### .git 폴더가 있는 동일 위치에 생성
touch .gitignore

### 파일 내용은 다음과 같다

### 파일 무시
test.txt

### 확장자 무시
*.txt

### 폴더 무시
test/

기존에 이미 push된 내용 중, 제외 항목이 있을 경우

1
2
3
4
5
6
7
8
9
10
11
git rm --cached test.txt
git rm --cached *.txt
git rm --cached test/ -r
git rm --cached . ### 전부 지우고 싶을 때

### 또는
git update-index --assume-unchanged {file_name}

### 이후 commit을 해 주어야 파일 삭제가 정상으로 이루어진다
git add .
git commit -m "Remove ingnored file"

git add –all(또는 *) 추가된 파일 Unstage하기

1
2
### 뒤에 파일명이 없으면 add한 파일 전체를 취소한다
git reset HEAD [file]

참조 링크

Git ignore-1

Git ignore-2

This post is licensed under CC BY 4.0 by the author.

Python에서 사용할만한 code refactoring library등

Git Error : refusing to merge unrelated histories