git-tag

How to get all commits in a Git tag through GitHub API

醉酒当歌 提交于 2020-05-27 04:12:45
问题 I have to fetch all new commits that were a part when a new tag was created on a Git repo. This needs to be done through GitHub API. For example the Git UI says Tagging Tag1 and has a sha associated with it... let's say the sha is : SHA1 Now how do I get all commits which happened or were a part of Tag1 through GitHub API? I want to store all these commits and perform some analysis on them. 回答1: Based on the clarification on your comment: I want to get all commits between this newly created

How to get all commits in a Git tag through GitHub API

强颜欢笑 提交于 2020-05-27 04:11:44
问题 I have to fetch all new commits that were a part when a new tag was created on a Git repo. This needs to be done through GitHub API. For example the Git UI says Tagging Tag1 and has a sha associated with it... let's say the sha is : SHA1 Now how do I get all commits which happened or were a part of Tag1 through GitHub API? I want to store all these commits and perform some analysis on them. 回答1: Based on the clarification on your comment: I want to get all commits between this newly created

Difference between tag and commit message

左心房为你撑大大i 提交于 2020-05-26 01:22:30
问题 I understand one always needs a message for committing the changes but when and why do I need to also tag a commit? Let's say I made some changes and I commit using git add -A git commit -m "add feature 1" and now git tag -a -m "includes feature 1" v0.1 The question is when does this make sense. 回答1: It would make sense to specify a tag when you release a version of the software you're producing. You could then do: git tag -a v1.0 -m "Release Version 1.0" Like my comment mentioned, you do not

How to get Git Tag in Azure Pipelines

隐身守侯 提交于 2020-04-09 07:50:04
问题 In Azure Pipelines, I have enabled git tags to trigger pipelines like so: trigger: branches: include: - '*' tags: include: - '*' Now I want to know if there is a way to determine programmatically: Was the pipeline started from a git commit or git tag? If the pipeline was started from a git tag, what is the tag name? 回答1: To check if the commit was from a tag, use: startsWith(variables['Build.SourceBranch'], 'refs/tags/') From James Thurley: Get the name of the tag with: $tags = git tag --sort

How to get Git Tag in Azure Pipelines

≯℡__Kan透↙ 提交于 2020-04-09 07:46:41
问题 In Azure Pipelines, I have enabled git tags to trigger pipelines like so: trigger: branches: include: - '*' tags: include: - '*' Now I want to know if there is a way to determine programmatically: Was the pipeline started from a git commit or git tag? If the pipeline was started from a git tag, what is the tag name? 回答1: To check if the commit was from a tag, use: startsWith(variables['Build.SourceBranch'], 'refs/tags/') From James Thurley: Get the name of the tag with: $tags = git tag --sort

Get tags of a commit

戏子无情 提交于 2020-03-27 03:17:49
问题 Given an object of GitPython Commit, how can I get the tags related to this commit? I'd enjoy having something like: next(repo.iter_commits()).tags 回答1: The problem is that tags point to commits, not the other way around. To get this information would require a linear scan of all tags to find out which ones point to the given commit. You could probably write something yourself that would do it. The following would get you a commit-to-tags dictionary: tagmap = {} for t in repo.tags(): tagmap

Git - rebasing to a particular tag

こ雲淡風輕ζ 提交于 2020-03-17 05:49:04
问题 (This seems like it should be very easy to do, yet I'm coming up empty on searches so far.) I have a body of code from an upstream source, with various versions tagged in it on various branches. I am working on my "develop" branch which was based on tag "v1.0". many versions have come out since then, but while "v2.0" is interesting, I want to rebase my develop branch to "v1.5" and continue working there (assume I don't plan to feed that back upstream). Maybe later I'll rebase it again to "v2

Get the time and date of git tags

馋奶兔 提交于 2020-03-17 04:00:05
问题 I have a project that is using git and have tagged all the releases with a tag. $ git tag v1.0.0 v1.0.1 v1.0.2 v1.0.3 v1.1.0 My goal is to list the releases and release dates in a web interface (tag/commit date = release date). Currently we list all the releases by using git tag . How can I get the time and date for when the tag was made (or the commit it points to)? 回答1: Use the --format argument to git log : git log -1 --format=%ai MY_TAG_NAME 回答2: This always worked for me: git log --tags

How to get the branch from tag name in Git?

泄露秘密 提交于 2020-02-04 01:29:33
问题 I am trying to get the branch name from a given tag. I tried git describe --tag <tag-name> but this doesn't provide me any branch name. I tried using gitk to show to the tags and branch but gitk doesn't show me the tag. When I list out the tags git tag -l I see the tag name exist in the list. I just want a simple command which can tell me the branch when tag name is provided. 回答1: Tags and Branches in Git are only Labels pointing to specific snapshot of your files. That being said, Tags ain't

Jenkins groovy - How to retrieve tag from latest commit?

半城伤御伤魂 提交于 2020-01-24 13:15:31
问题 To fetch the latest commit from branchName , we run below code: treeMapData = git(branch: branchName, credentialsId: credential, url: "${gitLabServer}/${projectName}/${repo}.git") It is ensured that there is one tag per commit, as per our workflow We want to build the code, only if the commit is tagged. How to retrieve the tag name for that latest commit? 回答1: We can fetch the tags from the repo in case Jenkins hasn't already. git fetch --tags We need to find a tag(s) which point to a