CI/git
[git] git history 제거하기 (초기화)
펭귄대장
2020. 2. 19. 20:42
1. git history 를 제거할 project(local repository) 최상위 경로로 이동
2. 기존 git 설정 모두 제거
rm -rf .git
3. git 새로 설정 및 commit
git init
4. .git/ 경로로 이동 후 아래와 같이 config 파일에 git 사용자 정보 추가
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = https://github.com/develo-pyo/boot-jpa.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
email = jungpyo9@gmail.com
name = develo-pyo
5. 모든 파일을 새로 add 및 commit
git add .
git commit -m "first commit"
6. git repository 연결 및 강제 push
git remote add origin {git remote url}
git push -u --force origin master
반응형