A Git Pull a Day Keeps the Conflicts Away
Avoid getting lost in a web of coworkers overwriting each other's code by using Git.
A Git Pull a Day Keeps the Conflicts Away
Avoid getting lost in a web of coworkers overwriting each other's code by using Git.
Git has changed my life as a programmer, both in solo and team-based projects. Early on, I learned the easiest way to push my way through a project was direct FTP file editing, having used my preferred code editor as the default that opened. This works well when by myself, but the moment I began including others on my projects; I was left with a huge problem:
My friends were overwriting my code.
Using Git as a Solution
For basic changes, this wasn’t much of a problem but became so when writing algorithms that would fall as the underlying code of the whole system. We dealt with it for months and finally one day we took a different approach to our server network. With that upgrade came major changes and what I would learn ultimately as the “systemic savior.”
Thus, our first repository was born.
Getting Used to Git
Git wasn’t easy to adjust to at first. Add, merge, commit, add, push, reset, pull origins? I didn’t understand a single bit of this new jargon that was being pushed as the solution to everything. I began reading, practicing, and asking questions. After a few weeks, I finally understood, Git was a simple version control system that monitors iterations for software and projects. Our initial setup was simple: we utilized the branching system and kept three separate levels for our network. Each of us developers had a local version, with Git being a Distributed Version Control, allowed for us to manage a personal copy for testing and initial development. At the next level, we had the main repository working with the master branch. This is what we considered the development level and testing was done with all the code that would be committed and pushed to this branch. Once ready and all testing was completed, we would merge the production branch with the master branch. The production branch is the code that gets built to the main server and is usable by all users.
The Immediate Benefits of Using Git
The benefits of this system, I quickly realized, were accountability, streamlined development, better project management, and rollback ability. By accountability, I mean that we were no longer worrying over who broke what, as with using GitLab we could visually manage who was committing what and this led to people paying more attention to the code they were adding. Streamlined development means that we can easily update code and automate a lot of our development process with hassle-free transfers between and development and production server. With better project management, it allows us to fully maximize the specific tasks, and by using commit messages one can follow the progression of a project. One of my most favorite functions is the ability to rollback staged files, commits, and even code/content pushed to a branch. It’s the four features that make me want to use Git on any project I dive into, including solo projects.
Making Coding Life Easier
Since then, I have used it in almost every project I touch that involves programming, both personal and professional. At AE, I now push for a Git setup at full speed with any project we can. It makes the production of sites much more streamlined, making it easier both for us as programmers and for project management. It also allows us to easy build and update code repositories, which couldn’t really be done without a version control system, and one easy as Git makes it even better.
Share Article
Topics
Keywords
- Back-End Development