Version control is a vital component of modern software design and git is the most popular version control system. Git is essential. It allows you to safely experiment, track changes, and it creates an organized workflow for something that can become chaotic fast. In this blog post, I will be going over some Git basics and some practical uses of git.
Git tracks changes in your code. This allows you to be able to go back to any version of your code and restore it if need be. This also allows you to see who’s done what work. this can help keep people accountable. Multiple people are also able to work at the same time without overwriting each other’s work. This makes collaboration much easier. Branching and merging allow anyone to be able to work with anyone whether they are in the same room or across the globe. Git also can allow you to experiment with your code. Branches allow you to manipulate and test code, without touching the source main code.
Basic git commands
Saving in git is called committing. If you commit you save the current state of all your files and folders. you would use git commit -m “message” This message should be a description of the changes made in this commit.
git clone is used to clone your current repository
git add is going to tell git that I would like to add this file as one to track the next time I make a commit.
Using the git add and git commit commands in conjunction allows you to only save/commit specific files.
Git status will tell you what is currently happening in your repository. You use this to help find where you are in git.
Git push sends the changes made up to Git Hub. This compresses all the information and sends it up to Git Hub.
git pull is the opposite of git pull. This allows you to bring the latest version of the project to your workspace.
Forking allows you to create a copy of someone else’s repository onto your own account.
Merge conflicts: this happens when changes coming from different locations conflict.
The Video I used as a source Is an amazing resource. It takes all the basic concepts of git and boils it down in a very simple and effective manner. It also shows examples of everything being used and talked about in a practical setting. I am a visual learner so I found this extremely helpful. The video is 50 minutes long, but if you are able to, you can watch this in 25 minutes at 2x speed with captions. I recommend anyone who is interested in git to watch this video. Even if you are experienced, it is an amazing refresher and I will be using it to study git concepts for this class alongside our material. I watched this video before attempting a git-related homework assignment and it felt like I was using git differently. I felt confident when using the commands. Before there was much more trial and error and I second-guessed myself a lot. Although the resource I chose doesn’t have much new information, I found it extremely helpful and encouraged anyone taking software processes management to check out this video.
Referance: https://www.youtube.com/watch?v=NcoBAfJ6l2Q&t=15s
tags: Week-14 , CS@Worcester, CS-343
From the blog CS@Worcester – SPM blog by Aaron Nano and used with permission of the author. All other rights reserved by the author.