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

How to hardReset to annotated tag #955

Closed
mumblez opened this issue Sep 9, 2018 · 1 comment
Closed

How to hardReset to annotated tag #955

mumblez opened this issue Sep 9, 2018 · 1 comment
Labels

Comments

@mumblez
Copy link

mumblez commented Sep 9, 2018

somewhat related to #954 and #772

I can successfully clone a project directly with it's annotated tag.
What I'm trying to do is fetch updates and then checkout the annotated tag, the tag gets reapplied to newer commits. I'm trying to use hardReset to checkout to the tag commit but for annotated tags I need a way to get at the real commit.

see code here that works for branches and lite tags - https://github.com/mumblez/gwg/blob/fb3579a765257ef8af21b4211f3675160654df0a/main.go#L204

but the reset fails for annotated tags, I'm guessing I have to add some steps to:

  1. detect if the tag is annotated or lite
  2. somehow get at the real commit hash
  3. do the hardReset

I may be going about this wrong so definately up for suggestions, but if you can help with the above steps that would be much appreciated.

@mumblez
Copy link
Author

mumblez commented Sep 11, 2018

managed to work something out - https://github.com/mumblez/gwg/blob/6710c1e1a27fe6250ed7260d2634092aaca0a3f3/main.go#L182

might not be the most idiomatic / cleanest way so if you have any suggestions that would be great.

I'll close this

@mumblez mumblez closed this as completed Sep 11, 2018
@smola smola added the question label Oct 3, 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