paint-brush
Git Essentials: Boosting Productivity w/ Efficient Code Tracking by@lumoslabshq
344 reads
344 reads

Git Essentials: Boosting Productivity w/ Efficient Code Tracking

by Lumos LabsJune 26th, 2023
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

This blog post discusses how software developers collaborate and track changes in their code using a tool called Git. Introduction What You Need to Know About DevOps Why Version Control Matters Your First Look at Git 5 Common Git Commands That Every Developer Must Know
featured image - Git Essentials: Boosting Productivity w/ Efficient Code Tracking
Lumos Labs HackerNoon profile picture


Version control systems have had a profound impact on software development ever since their adoption in the 70s.


Using version control systems (VCS) in software development has become all but necessary and which is why 70% of software development teams use a VCS like Git for their versioning needs.




If that’s not enough, there continues to be a steady increase in adoption in recent years as these systems improve both code management as well as code quality and accuracy.


Given how important these benefits are to the much-touted DevOps philosophy, it should come as no surprise that version control systems have become even more important in modern software development.


What You Need to Know About DevOps

Even if the Software Development Life Cycle (SDLC) has held sway for a while now, there are emerging philosophies that promise to deliver applications and services with shorter turnaround times.


One such philosophy is DevOps: a set of practices that go beyond traditional software development with the intent to accelerate a product’s time-to-market and as a result, serve customers efficiently. In particular, there’s a focus on automation and streamlining that should help its practitioners build software faster.


When it comes to the application of such a software development methodology, both the development and operations teams collaborate and share responsibility towards the effort of building secure, feature-rich software as quickly as possible. Of course, DevOps teams also tend to examine what real users need and include these features in their quick, incremental updates.




On the whole, this antiquated business of teams working in silos is done away with, thanks to the use of a new set of tools that aid in sharing and collaboration. In being able to communicate and share feedback faster with these tools, an accelerated time-to-market of the said software product is achievable, making the DevOps philosophy desirable to adopt.


Speaking of DevOps tools, using a version control system (VCS) like Git is probably the most sought-after. Especially since DevOps has begun to play a prominent role in software development.

Why Version Control Matters

As you already know, a version control system - much like Git - is responsible for managing your code and all the changes that have taken place since the project’s beginning. In other words, a complete history of your code is maintained, avoiding any manual management altogether.


When you use such a source code management tool, you will obtain information about the changes made, the timestamp at which the change was made and the person who made such changes. Given how thorough a VCS is in managing all versions of the project source code, there’s no chance of accidental changes. Yet more importantly, teams can work on projects simultaneously while creating branches and merges on the said project to maintain a good ‘mainline’.


Concerning the DevOps methodology, a version control system tends to support collaboration and shared feedback through its ability to manage and track files in an automated fashion. Your team gets to see the source code since it is kept in one location for all to access with maximum visibility: all team members can see who is working on what files so that duplication does not take place either.**


There are two types of version control systems - distributed and centralized. While the former allows each user to store a copy on their local machine, the latter gives users access to a central server. When it comes to distributed version control tools, most software development teams use Git.

Your First Look at Git

Authored by Linus Torvalds, Git was first released for use in 2005 to keep track of the development of the Linux kernel.


Being open-source software, Git can be downloaded from the website based on the operating system that you have running on your system. Yes, this includes Windows too!



Once you’ve installed Git on your system, there are two ways by which you can use this VCS: by using the terminal or a GUI. Several GUIs have been designed to make Git more user-friendly but using the terminal has always been the preferred approach.

Speaking of which, the very first command that you must use after installing Git is to check whether it is available on your system or not:


In addition, if you want to version control one of your projects, you will have to create and navigate to a project directory by using the following commands:




Once you have created a project, it’s time to create a Git repository that will track all source code changes by running the following command:


Now, once you have completed this, there are common Git commands that you will use when writing source code in your projects, and which are worth exploring next.**


5 Common Git Commands That Every Developer Must Know

As we’ve discussed earlier, most developers use Git as it plays an important role in modern software development.


So, if you consider versioning important for your coding projects, here are 5 common Git commands that every developer must get familiar with:

Command #1: git config

As the name suggests, this command sets configuration options, either in a global sense or for a repo.


Two common uses for this command include setting the user name and email address:



Command #2: git status

As you can see from the output below, the git status command provides you with information about the staging area and working directory. In particular, you get to see the changes made and also the files that Git isn’t yet tracking.


Command #3: git add

When you run this command, you will add the changes from the working directory to the staging area. What you are doing is telling Git that you intend to make changes to a file when you run the commit command.


** **


Command #4: git commit

This commit command will help you to save all changes made to the staged area and is considered to be a ‘safe’ version of the project as the changes made are first added while the commit command ensures that these changes are saved to the local repo.



Command #5: git log

This command provides the developer with the ability to look at a project’s particular history so that a particular version of the project can be found. Several arguments can be added to refine this search.


Now, it wouldn’t be fair not to mention Github since it hosts all Git repositories online so collaboration is made much easier between developers. As a developer, there are three more interesting commands that you can learn and that work with code hosted on Github: git push, git pull and git clone.



Like what you’re learning?

Want to apply these skills in the Web3 world?

Lumos Academy - a Web3 education platform dedicated to teaching you blockchain development concepts with comprehensive curriculums.


Take a look and get ahead of the learning curve: https://academy.lumoslabs.co/