Source Control Ninja Level - Pt. 1 Definitions
I've been wanting to cover some of this in a series of blog posts before I dig deep with everything I'm learning from a development perspective. I feel source control or version control is a tool that everyone could stand to understand better and ultimately use!
When I wrote 3 Learn modules during 2020 and 2021, I found myself inside a hefty dose of source control. I actually thought I knew source control, until I was shown I knew nothing (or at the bare minimum, I knew enough to act like a toddler who's learning to walk).
As a quick sidebar, here are the Learn modules I authored during my time as a Cloud Advocate at Microsoft (shameless plug):
Back to the task at hand: source control. To do a quick level set during this first post, I wanted to cover a few definitions so we're all on the same page:
Source control - The practice of tracking and managing changes to software code. Also known as: version control, revision control, or source code management.
Git - Software for tracking changes to any set of files, usually used for coordinating work between developers or programmers collaboratively developing projects and solutions.
Repository - Each git project is called a repository or repo for short. Each repository stores all files and changes made to any given project. A repository stores data and all change information over the course of the project's life.
Local repository - A git repository that is stored on your computer. The local repository is where developers or programmers make local changes. Typically the local repository is on your computer or server.
Remote repository - Versions of your project that are hosted online or over a network. For example, GitHub repositories are remote repositories.
Commit - An operation which sends the latest changes of the source code to a repository.
Clone - A copy of any given repository or the action of copying a repository to a new repository.
Branch - A software management technique to maintain stability, while isolated changes are made to the code. Branching facilitates the development of bug fixes, the addition of new capabilities, and the integration of new versions after these changes have been tested in isolation. Companies create branches to develop application files separately from the main application. If several people work on the same code base, it quickly becomes impossible for them to work on the same files. Branching allows all developers or programmers to take a copy of the code base and alter or change the repository files.
Fork - A quick definition would be someone taking the repository's current code base and using it as a basis for a separate or alternative project. With git though, a fork is also often used to contribute to the original project. I'll cover this during a later blog post.
Checkout - The process of checking out a branch or main/master into a local repository. When working locally, you may want to work on a branch vs. the main code line. This cleans up the flow and helps you easily track changes to the code base.
Push - This process is used to upload the local repository to a remote repository. Pushing is how you transfer commits from your local repository to a remote repository.
Pull/fetch - Pull or fetch grabs the latest changes and merges them into your current branch.
Pull request - The process of letting everyone know you have changes you'd like to be merged into the main repository for future use/reference. A contributor asks a maintainer of a git repository to review code they want to merge into a project.
Head - The term refers to the current commit being viewed. By default, you'll view the tip of the main branch on a repository (could be "master" in this instance as well).
Merge - This is git's way of putting a forked history back together again. The git merge command lets you take the independent lines of development code created by the git branch command and integrate everything into a single branch.
Now that I've covered all definitions, stay tuned for a future blog post where I start laying out different scenarios to help you get to that "ninja" level with source control!