Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

git checkout of tag doesn't work in local area #980

Closed
a-wf opened this issue Oct 9, 2018 · 5 comments
Closed

git checkout of tag doesn't work in local area #980

a-wf opened this issue Oct 9, 2018 · 5 comments
Labels

Comments

@a-wf
Copy link

a-wf commented Oct 9, 2018

I tried the command git checkout $TAG

I notice it displayed taht it'is done. Hovewer, when I verified with command line "git describe --tags"
It show me, not the commit with tag, but the last commit pushed

@smola smola changed the title git checkout doesn't work in local aera git checkout doesn't work in local area Oct 11, 2018
@smola
Copy link
Collaborator

smola commented Oct 11, 2018

@akdj Could you describe what did you do with go-git and git exactly? It seems you are trying to use some git commands on a repository you checked out with go-git, but we need to know the code you used to checkout.

@a-wf
Copy link
Author

a-wf commented Oct 11, 2018

Hi @smola ,
With go-git, I made a git clone of one of my gitlab repositories, then I tried to check out a tag release. it seems to be a "sucess" (there is a ''nil' error). So I stop my app. And in the local git repository that I just clone, I did a 'git describe --tags' for checking if it is really checking out.
As a result, the HEAD is on master branch's last commit. like the go-git checkout command is never performed.

Unfortunately, I didn't make a backup of this block of code... It is very similar to the example provided here indeed I copy paste

@a-wf
Copy link
Author

a-wf commented Oct 11, 2018

I tried the command git checkout $TAG

I notice it displayed taht it'is done. Hovewer, when I verified with command line "git describe --tags"
It show me, not the commit with tag, but the last commit pushed

sorry for my bad english... :)

@smola
Copy link
Collaborator

smola commented Oct 11, 2018

@akdj Thank you, we'll look into it.

@smola smola changed the title git checkout doesn't work in local area git checkout of tag doesn't work in local area Oct 26, 2018
@smola
Copy link
Collaborator

smola commented Oct 30, 2018

@akdj You must checkout by commit hash. If you want to checkout a tag, you will have to get the commit that tag points to first. See #985

@smola smola added the invalid label Nov 5, 2018
@smola smola closed this as completed Nov 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants