모든 Git 태그를 나열하는 방법은 무엇입니까?
내 저장소에서 다음 명령을 사용하여 태그를 만들었습니다.
git tag v1.0.0 -m 'finally a stable release'
git tag v2.0.0 -m 'oops, there was still a major bug!'
저장소의 모든 태그를 어떻게 나열합니까?
git tag
충분해야합니다. 참조 git tag
man 페이지
또한 :
git tag -l <pattern>
주어진 패턴과 일치하는 이름을 가진 태그를 나열합니다 (또는 패턴이 제공되지 않으면 모두).
인수없이 "git tag"를 입력하면 모든 태그가 나열됩니다.
최근에 ( " How to sort git tags? ", for Git 2.0+)
git tag --sort=<type>
특정 순서로 정렬합니다.
지원되는 유형은 다음과 같습니다.
- "
refname
"(사전 순서),- "
version:refname
"또는 "v:refname
"(태그 이름은 버전으로 처리됨).정렬 순서를 반대로하려면 앞에 "-"를 추가합니다.
두 가지 모두 나열됩니다.
- 주석이 달린 태그 : Git 데이터베이스에 저장된 전체 개체. 체크섬입니다. 태거 이름, 이메일 및 날짜를 포함합니다. 태그 메시지가 있습니다. GPG (GNU Privacy Guard)로 서명하고 확인할 수 있습니다.
- 경량 태그 : 기존 커밋에 대한 간단한 포인터
참고 : 태그 지정에 대한 git ready 문서 는 경량 태그를 승인하지 않습니다.
인수가 없으면 git 태그는 기본적으로 절대 이동하지 않는 분기 인 "경량"태그를 만듭니다.
경량 태그는 알려진 좋은 (또는 나쁜) 버전을 표시하거나 향후에 사용해야 할 커밋을 표시하는 데 여전히 유용합니다.
그럼에도 불구하고 이러한 종류의 태그를 푸시하고 싶지는 않을 것입니다 .일반적으로 최소한 -a 옵션을 전달하여 서명되지 않은 태그를 생성하거나 -s 또는 -u 옵션을 통해 GPG 키로 태그에 서명하려고합니다.
즉, Charles Bailey 는 ' git tag -m "..."
'는 실제로 -a
경량 태그가 아니라 적절한 (서명되지 않은 주석이 달린) 태그 (옵션 ' ')를 의미 한다고 지적합니다 . 따라서 초기 명령에 능숙합니다.
이것은 다음과 다릅니다.
git show-ref --tags -d
커밋과 함께 태그를 나열합니다 ( " Git 태그 목록, 커밋 sha1 해시 표시 "참조).
주 -d
(자신의 커밋 자신의 SHA1이) 주석 태그 객체를 역 참조 커밋 태그 실제를 표시하기 위해.
마찬가지로 git show --name-only <aTag>
태그 및 관련 커밋을 나열합니다.
선호하는 태그를 나열하려면 :
git tag -n
-n
플래그는 태그와 함께 주석 메시지의 첫 번째 줄을 표시하거나 태그가 주석되어 있지 않은 경우는 첫 번째 메시지 라인을 커밋합니다.
git tag -n5
주석의 처음 5 줄을 표시 할 수도 있습니다 .
또한 git show-ref
다소 유용하므로 태그 를 해당 커밋 과 직접 연결할 수 있습니다 .
$ git tag
osgeolive-6.5
v8.0
...
$ git show-ref --tags
e7e66977c1f34be5627a268adb4b9b3d59700e40 refs/tags/osgeolive-6.5
8f27e65bddd7d4b8515ce620fb485fdd78fcdf89 refs/tags/v8.0
...
원격 태그를 찾는 방법은 다음과 같습니다.
git ls-remote --tags origin
만들려고 git tag
그것을 만들려고하지 않으면 충분해야 git fetch
다음 git tag
.
사용 가능한 최신 태그에 대한 세부 정보를 보려면 가끔 사용합니다.
git show `git describe` --pretty=fuller
Git에서 사용 가능한 태그를 나열하는 것은 간단합니다. 입력하기 만하면됩니다 git tag
(선택 사항 -l
또는 사용 --list
).
$ git tag
v5.5
v6.5
특정 패턴과 일치하는 태그를 검색 할 수도 있습니다.
$ git tag -l "v1.8.5*"
v1.8.5
v1.8.5-rc0
v1.8.5-rc1
v1.8.5-rc2
git 저장소에서 최신 태그 가져 오기
The command finds the most recent tag that is reachable from a commit. If the tag points to the commit, then only the tag is shown. Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object and the abbreviated object name of the most recent commit.
git describe
With --abbrev
set to 0
, the command can be used to find the closest tagname
without any suffix:
git describe --abbrev=0
Other examples:
git describe --abbrev=0 --tags # gets tag from current branch
git describe --tags `git rev-list --tags --max-count=1` // gets tags across all branches, not just the current branch
How to prune local git tags that don't exist on remote
To put it simple, if you are trying to do something like git fetch -p -t
, it will not work starting with git version 1.9.4
.
However, there is a simple workaround that still works in latest versions:
git tag -l | xargs git tag -d // remove all local tags
git fetch -t // fetch remote tags
If you want to check you tag name locally, you have to go to the path where you have created tag(local path). Means where you have put your objects. Then type command:
git show --name-only <tagname>
It will show all the objects under that tag name. I am working in Teradata and object means view, table etc
You can list all existing tags git tag
or you could filter the list with git tag -l 'v1.1.*'
, where *
acts as a wildcard. It will return a list of tags marked with v1.1
.
You will notice that when you call git tag
you do not get to see the contents of your annotations. To preview them you must add -n
to your command: git tag -n2
.
$ git tag -l -n2 v1.0 Release version 1.0 v1.1 Release version 1.1
The command lists all existing tags with maximum 3 lines of their tag message. By default -n
only shows the first line. For more info be sure to check this tag related article as well.
참고URL : https://stackoverflow.com/questions/1064499/how-to-list-all-git-tags
'program tip' 카테고리의 다른 글
객체가 jQuery 객체인지 확인 (0) | 2020.10.03 |
---|---|
숨겨진 커밋되지 않은 변경 사항을 복구하는 방법 (0) | 2020.10.03 |
특정 클래스 나 속성이없는 요소를 선택하는 CSS 선택기를 작성할 수 있습니까? (0) | 2020.10.03 |
두 JavaScript 객체의 동등성을 결정하는 방법은 무엇입니까? (0) | 2020.10.03 |
Xcode의 버전 대 빌드 (0) | 2020.10.02 |