GIT

지니씨·2022년 12월 21일
0

기타

목록 보기
17/20

커밋 합치기

https://korband.tistory.com/33
1. git rebase -i HEAD~3 (3개의 커밋을 바꾸겠음)
2. 커밋 정리
: 과거->현재순으로 커밋 정보 나열
: 합칠 커밋을 pick->s 로 수정 (pick인 커밋만 유지)
: 최상단 커밋만 pick, 나머지 s 라하면 모든 내용 과거 최초 커밋에 합쳐짐
3. 합쳐서 보여줄 커밋명 수정, :wq
4. 강제 push git push -f origin [branch_name]

push한 커밋명 수정

https://data-study-clip.tistory.com/237
1. git rebase Head~1 -i
2. i 눌러서 편집모드 들어간뒤 pick -> reword로 수정하고 commit 메시지 수정
3. 수정한 내용 저장한뒤, git push --force로 메시지 덮어씌우기

archive

https://stackoverflow.com/questions/1307114/how-can-i-archive-git-branches
1. create tag
git tag archive/<branchname> <branchname>
2. Push local tag to remote
git push origin archive/<branchname>
3. 브랜치 삭제
Delete the branch locally
git branch -D <branchname>
Delete the local reference of remote branch ("forget" the remote branch)
git branch -d -r origin/<branchname>

profile
하루 모아 평생 🧚🏻

0개의 댓글