DEV Community

Yinka
Yinka

Posted on

How did you understand Git and its workflow.

After reading another 'Git for beginners' article or tutorial on the internet, I would learn the basic git commands like git commit and git init, feel like 'I finally got it now' then go on and initialize git in my project.

After a few commits, maybe after renaming a file, the number of pending changes in VSCode that makes me dizzy or trying to revert to the last commit, I always end up messing the repo. It always ends in tears.

I would end up removing git, finish my project, git init and commit the renowned initial commit and push to GitHub. If you cant relate you are lucky.

Discussion (4)

Collapse
srleyva profile image
Stephen Leyva (He/Him)

Codecademy has a good course:
codecademy.com/learn/learn-git

I think of it like time travel. Each commit is a checkpoint where you can travel back to or undo. However, Two people operating on the same object at the same time can result in conflicts or race conditions of sorts. Git doesn’t know how to reconcile these differences, so you the time lord (fez included) must fix these conflicts. Hopefully the analogy and course are helpful.

Collapse
bravemaster619 profile image
bravemaster619

Time travel, yeah you can say that again

Collapse
srleyva profile image
Stephen Leyva (He/Him)

Different branches == different time streams...makes me feel like Dr. Who on a daily basis 😂😂

Collapse
jessekphillips profile image
Jesse Phillips

Well it has been too long for me to explain how I understood git. I actually started posting to Dev.to because I wanted to convey the importance of using more than just the basics of git.

It is interesting you mentioned wanting to revert to a previous commit and the solution is to throw out git until you're done. File systems don't have previous commits (not in the context we are discussing).

Maybe start with why and then you'll be better prepared to seek how.