[Git] git game - commit 순서 변경/내용 수정, tag, describe
2024. 7. 9. 09:56ㆍGit
728x90
반응형
SMALL
git commit --amend
top 커밋 내용 수정
git rebase -i 사용 시 순서 변경할 경우 충돌 발생 가능
=> cherry-pick 활용
git tag [tag name] [object commit]
특정 커밋들을 브랜치로 참조하듯이 영구적으로 가리킴
[object commit] 명시하지 않으면 HEAD가 가리키는 커밋으로 취급
커밋들이 추가적으로 생성되어도 Git 태그는 움직이지 않음
git describe [object commit]
출력 형식 : <tag>_<numCommit>_g<hash>
가장 가까운 부모 태그 출력
-[object commit]도 포함하여 부모 태그 탐색
[object commit] 생략 시 HEAD 커밋 사용

git describe main
//output: v1_2_gC2
git describe side
//output: v2_1_gC4
git game 정답


git checkout main
git cherry-pick c4


git rebase -i HEAD^^
git commit --amend
git rebase -i HEAD^^
git branch -f main c3''


git checkout main
git cherry-pick c2
//git commit --amend
git branch -f main c1
git cherry-pick c2' c3


git tag v0 c1
git tag v1 c2
git checkout v1


/**
git describe ...
**/
git commit
728x90
반응형
LIST
'Git' 카테고리의 다른 글
| [Git] git game - clone, fetch, pull (0) | 2024.07.09 |
|---|---|
| [Git] git game - 2 argument rebase, ^ with number (0) | 2024.07.09 |
| [Git] git game - cherry-pick, interactive rebase (0) | 2024.07.08 |
| [Git] git game - HEAD, branch -f, reset, revert (0) | 2024.07.08 |
| [Git] git game - commit, branch, checkout, merge, rebase (0) | 2024.07.08 |