[DevOps]GitHub 관리 기술

Philip Sung·2023년 10월 16일
0

[DevOps]

목록 보기
2/6
post-thumbnail

01 개요

본 문서에서는 GitHub를 관리하는 과정에서 필요한 여러가지 테크닉에 대해 다룬다.

최종수정일 :2023.10.16




02 과거 커밋 이력 공개 없이 공개범위 변경

https://stackoverflow.com/questions/39336842/make-git-repo-public-without-revealing-past-commits

git checkout UserCommitHash

원하는 커밋으로 이동한다.

git reset InitialCommitHash --soft

초기 커밋으로 이동한다.

git commit --amend -m "My new initial commit"

amend 옵션과 함께 커밋한다.

git push your_remote main

퍼블릭 리포지토리에 푸시한다.

클론한 리포지토리를 푸시할 수도 있지만 이렇게 진행할 경우, git reflog 명령어를 통해 조회할 수 있지만 원격 저장소에 푸시되지는 않는다.

또한 첫번째 커밋의 아이디를 얻기 위해서는 아래 글에 나온 명령어를 사용할 수 있다.
(https://stackoverflow.com/questions/5188914/how-to-show-the-first-commit-by-git-log/5189296#5189296)

git rev-list --max-parents=0 HEAD

profile
Philip Sung

0개의 댓글