While cleaning up my blog after the switch from WordPress to Ghost I came a cross an old draft I had saved from a few years back. The draft notes my first encounters with git and the whole idea of tracking code using a version control tool.
Git is basically a big history of commits.
I struggled with the idea of committing every change I made to my code.
It was hard to get the concept of committing my code because I had develop bad habits, by creating my own structure of organizing code.
The way I did it was, If I was working on a project, and then I needed to run some tests in a plugin, or in a piece code, or whatever I might need, I would create a new folder and run the test there, sometimes just comment the old code in the page and write new code, or just create a new file and write the tests there.
The major problem of doing that, was that after a week I had no idea of what I did. I simply couldn’t remember what I was testing, what were the results of the test, and I would go back to the beginning again.
Usually, If I was working in a project continuously, without any breaks that wouldn’t be a problem since all the changes would be fresh in my mind. However, I found myself in a situation that I had to take a week, maybe more from one project. When I tried to start the development again, I would be really lost, no idea of what I was doing, or what I supposed to do.
Without many options, I decided to switch things a little bit, and start using git for all my development.
At the beginning was hard, since I couldn’t visualize what was going on, everything seemed like a black-box.
The whole idea of branches, commits, fetches, pull, merges, were new to me, and I didn’t have a clear image in my mind of what they were doing. I feel that right now I’m scratching the surface of git.
I have a basic understanding of the git commands, and what they do, and most important why they do it.
The way I set it up my dev environment now is like this:
- Using Netbeans as my main IDE.
- Netbeans has a Git plugin that makes easy to code and commit the changes to the repo.
- Gitg to visualize the branches, merges and commits
- And of course, using git bash to fetch, pull, push.
I haven’t encountered any merge problems yet, so I don’t know what tool to use it, but I have a feeling that I’ll need one very soon