DEV Community

Discussion on: First month in DevOps

genei09 profile image
Aaron Sua

Git can be rough for new comers to understand for sure, but I wouldn't blame the tool for what happened. Misunderstanding and misuse is all that happened. Digging into how the binary tree of git and calculation of differences operates will help a great deal.

It's relatively easy for us humans to look at a file and say: "Both of these lines are the same, why is there a conflict?", but when you consider what git is tracking it makes sense. It isn't just what the content of a file is, but the history, parentage, and attribution of that change. So git sees that the same line in a fire was edited by two users at different times with different parentage. That causes a conflict. Even without making the mistake of passing files outside of git, you can hit similar issues by using squash and rebase to change the history in git.

Having a deep understanding of git is very fundamental in DevOps IMHO. There's a lot of creative git use needed in CICD.

monotiller profile image
monotiller Author

Oh absolutely, I think Git is a great tool and I am going out of my way to force myself in to weird situations where stuff like this happens, but I do feel like sometimes it's not entirely clear what I'm about to do until after I've done it. But I've never lost files because of it, the example I mentioned in the post was the only problem we had so I think we've got the basics down at least.

So far this has been the hardest thing I've learnt in the course, but I'm not giving up on it because I don't want to suffer a data loss again.