TOOL/VCS 2017. 4. 27. 15:00

!markdown


# Git (깃)


대부분 Git의 Tag정보를 이용해서 버전관리를 한다.


Git은 터미널 명령어로 최신 git의 태그정보를 출력해주는 기능이 있기 때문에 


이를 잘 활용하면 된다.



### Tag (태그)


`최신 Tag명`

```bash

git describe --tags --abbrev=0

```


(`최신 Tag명`) + (`최신태그명으로부터 Commit 갯수`) + (`현재 HEAD의 SHA1 ID`)

```bash

git describe --tags

```


### Branch (브랜치)


현재 Checkout되어있는 `Branch명`

```bash

git rev-parse --abbrev-ref HEAD

```



### 참고


[http://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git](http://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git)

'TOOL > VCS' 카테고리의 다른 글

[Git] remote 추가하기  (0) 2019.12.23
[Git] 모든 태그를 지우기  (0) 2017.09.23
[Git] gitk 소스내용 한글 깨짐 해결  (0) 2016.08.12
[Git] reflog 작업 복구하기  (0) 2016.07.15
[Git] SSH 공개키 생성  (0) 2016.06.21