Skip to content

Add a commit (and push) to a tag #24929

Answered by Simran-B
JJ asked this question in Actions
Discussion options

You must be logged in to vote

actions/checkout@v2 does a shallow clone by default, so the history will be grafted and no remote branches will be available. You need to set the fetch-depth option to 0 to get the full history and the branches. Then git checkout master should work.

If the tagged commit is on the master branch, you can then git reset --hard <tag>. Or you could do git checkout <tag> -B master to checkout the tag as a new branch “master”, overwriting (!) the existing local branch. But I’m not sure if that is what you want to do.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants