Coding tutorials can be difficult to structure. It’s often so easy to get caught up in your expanding code base and keep track of important project...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for this! I didn't know the difference between lightweight and annotated tags.
I also use tags when trying to identify when a bug was introduced. I normally create "before-x", "after-x" tags to quickly jump between commits without accidentally checking out the wrong thing (which would add even more confusion)
For debugging you should really look into git bisect.
Maybe it’s not a good way for you but it’s specially useful and iirc designed for debugging/finding which commit introduced the bugs you’re looking for.
Awesome! Thanks! I didn't know about git bisect either!
No problem mate!
I have seen some really interesting articles on it but I am not sure where exactly. I think I could find it if I were to bother but I have actually never used it as I have always used my own system. Even so it’s good to have alternative methods for things and if nothing else it’s something new to learn and by extension come up with new ideas and so on.
It should be remembered too that you can use it for more than just finding a commit a bug was introduced. In the end binary searching is a valuable tool and you can use similar systems for making decisions irl by taking a list of things and breaking them into the keep pile until you finally have two left.
Anyway glad to have offered something useful!
Cheers.
...or use Git Tutor
Didnt know a bout git tutor, thank!
That's really smart! Many thanks for this helpful write-up.
We also tried to address this with gitpod.io snapshots, which allow you to capture and share the full state of a workspace with a URL (see ssloy's awesome 3D tutorials using snapshots for each step: github.com/ssloy/tinyraycaster/wik... ).
But today I learned that you can also do it with tags. Thanks again!
Thanks for the article!
I've been going back and forth on my approach and I wonder if you have a preference.
Would you prefer:
step-02
is tagged to the latest in a branch that is created off ofstep-01
which was created off ofstep-00
). This seems like it could be more complex to maintain, but results in those taking the tutorial pulling down the "before" version at first.Not sure which way to go, and wasn't sure if you or other readers here might have some preferences.
Thanks again!
very nicely presented and explained, am gonna try on my repos
one question, is it possible to add tags to a particular commit in history?
I'm not sure, you'd have to check the official documentation :)
Yes. Yes you can. See the following for example :
stackoverflow.com/questions/440417...
cool, thanks for the link, exactly what I was looking for :)
Welcome mate!
Pretty cool! I've been writing some CF tutorials recently, and I briefly wondered "Hmm, would Git tagging make this way easier to switch between examples?" Because otherwise you either give the student/reader the Full Working Code, or nothing at all.
Thank you! I'll give tags another shot.
Great article and fantastic technique to help others learn. :)
As always: Very useful. I knew about tags and used it very poorly. This article gave more insight (I didn't knew the difference between lightweight and annotated tags before)
good article!
Great post as we are currently going thru this exercise for a current project and this is helpful.
I am doing a monogame tutorial and I using branches instead. Is very useful
Genius idea! Thank you for sharing!
Aw thanks Joe!
Milestones great.
Not sure why I always neglect tags, but clearly I'm missing out. Thanks for the inspiration.