Git
-
git 복구하기Git 2024. 5. 29. 18:44
git reset --hard 를 잘못 사용해서 작업한 파일을 다 날렸을 때 당황하지 말자. commit 을 한 경우1. git reflog로 내가 입력 했던 명령어 확인 2. git reset --hard {돌아가고자 하는 해시}ex) git reset --hard e4ebfa6 commit을 하지 못 한 경우git add 를 하고 실수로 git reset --hard를 해버린 경우에도 당황하지 말자. 1. git fsck --lost-found 2. git show {id}ex) git show 02f88792a956f20cef80a9639e60520814a13af4 하나 하나씩 확인해서 최대한 복구하자
-
Git 이미 푸시된 Author 와 커미터 수정하기Git 2021. 2. 16. 18:41
바꾸고자 하는 프로젝트를 clone으로 가져온 후 git filter-branch --env-filter ' OLD_EMAIL="your-old-email@example.com" CORRECT_NAME="Your Correct Name" CORRECT_EMAIL="your-correct-email@example.com" if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] then export GIT_COMMITTER_NAME="$CORRECT_NAME" export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" fi if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ] then export GIT_AUTHOR_NAME="$CORRECT..
-
remote repository와의 sync 맞추기Git 2021. 1. 5. 18:26
특정 다른 remote repository의 commit log 이력까지 가져오려면 다음과 같이 진행한다. 1. 현재 추가되어 있는 remote repository 확인 git remote -v 2. git remote add {name} {git-repo} // name은 별칭 , git-repo는 repository의 주소 (.git) git remote add test https://github.com/des/test.git 3. remote repo에서 pull git pull {git remote 에서 설정한 별칭} {가져올 브랜치} ex) git pull test remobranch 4. 나의 remote repository에 push하여 sync 맞추기 git push //git push o..