Bitbucket and the Secret of Source Control | Git | Atlassian | Version Control System
Picture this: A website or an application often contain hundreds of code files. A change in one of these can have major impacts on many features. Add many changes each day, probably made by several people working on different aspects of the same project, and we get the perfect recipe for disaster.
Why did this feature make an error this morning, when it was working properly yesterday? Who edited menu.css? Do these files match what is deployed in production?
This is where the right tools and work practices come into play, in an effective development team. The cornerstone is versioning software, commonly known as source control. Of all the software options, one of the most popular is undoubtedly Git. Here is how a programmer would use such software:
- Gets the most recent version of the entire project code from Git
- Modifies locally on the workstation and tests it
- Validates that there is no conflict with the most recent competing changes from his team
- Reviews his changes, makes sure they match a specific task to push them to the repository
“If the code isn't checked into source control, it doesn't exist.”
I have read and heard many versions of this quote, this being undoubtedly the oldest one, written by Jeff Atwood in this bill Coding Horror.
Even the smallest project cannot do without it, and should constantly use it. Take this example. Hector makes a quick edit on a site, and does not update the file in Git. 2 weeks later, Bernard makes a different change. The next day, we find a problem that had already been solved has reappeared. Centralizing the code and its revisions avoids such problems.
Describe and Document
Without getting into a comprehensive documentation, a clear and concise comment linking to a task in collaboration software such as JIRA, makes it easy to search through the change history in a project. Being able to easily identify which version has been deployed is also very useful.
Any modification should be tested to validate its proper functioning, ideally before sharing it with your team. This should also be done on versions merged with your collaborators’ revisions.
The project code is already well managed and versioned? Why not automate the process even more? The code can be retrieved from Git by a continuous integration server for testing and deployed automatically, reducing common errors and oversights that may occur during manual operations.
Such a tool is essential for our team to maintain the quality of our projects. Bitbucket proved to be an excellent choice for ease of use and productivity, price, and integration possibilities with other services. What about you? What is your favourite tool?