Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## remote 장소 구체적인 정보 확인
- ```
- # git remote show [remote name]
- $ git remore show origin
- ```
- ## tag 만들기
- tag는 `Lightweight`, `Annotated` 태그가 존재
- ### Annotated
- - 태그를 만든사람의 이름, 이메일, 태그를 만든날짜, 태그메세지 저장 가능
- ```
- # Annotated Tag
- # -a 옵션을 추가해서 생성
- $ git tag -a v0.1 -m "first version 0.1"
- $ git tag
- v0.1
- ```
- ```
- # git show [tag]로 태그정보와 커밋정보 확인
- $ git show v0.1
- ```
- ### Lightweight 태그
- - 기본적으로 파일에 커밋 체크섬을 저장하는것뿐
- - `-a`, `-s`, `-m` 옵션을 사용하지 않는다.
- - 단순한 커밋정보만 보여준다.
- ```
- $ git tag v0.1-lw
- $ git tag
- v0.1-lw
- ```
- ### 나중에 태그하기
- 예전 커밋에 대해서 태그달기
- ```
- $ git log --pretty=oneline
- 7e96c8d01f3f38c2fc7e0481acc949ec95a9edbc fix collectstatic bug
- f292c4fd804c4ccfb5d405eb271ea59a39880287 refactor static file for collectstatic
- f9cccec5078beec09cd02c4643c0947f1a2e0480 init SkillSerializer, DeveloperSerializer, add Resume html,
- ```
- 위와 같은 log가 있다고 했을때, `init SkillSerializer, DeveloperSerializer, add Resume html` tag 달기
- ```
- $ git tag -a v0.3 f9ccce
- ```
- 위와같이 입력했다면 `Annotated` 태그이기 때문에 tag에 대한 message을 입력하라고 뜰것이다.
- 위 작업시 유의할 사항은 `중복 tag번호`는 안된다. 이미 만들어진 tag라면
- ```
- fatal: tag 'v0.3' already exists
- ```
- 위와같은 에러가 뜰것이다.
- ### 태그 공유하기
- **git push 명령은 자동으로 remote 서버에 태그를 전송하지 않는다.**
- 그래서 별도로 Push해야 한다.
- ```
- # git push origin [tag name]
- $ git push origin v0.3
- # multiple tag push
- $ git push origin --tags
- ```
- ### tag checkout
- **태그는 브랜치와 달리 가리키는 커밋을 바꿀 수 없는 이름이기 때문에 Checkout해서 사용할 수 없다.**
- 태그가 가르키는 특정 커밋기반의 브랜치를 만들어 작업하려면 아래와 같이
- ```
- $ git checkout -b branch name v0.3
- Switched to a new branch 'branch name'
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement