Learning Gitflow With GitHub
In this blog, we will talk about:
· GitHub and why software engineers use it
· When do we use GitHub
· Forking/cloning/pulling repositories
· Add/commit/push our repositories to GitHub
One of the most valuable resources a software engineer has is GitHub. Github is a code hosting platform for version control and collaboration. Github provides a cloud based platform to save and store our code repositories. In layman’s terms, github allows coders to upload and save multiple checkpoints when they are working on their projects/repositories. Github also allows coders to work together on project without overwriting each others data.
So why is version control so important with coding? Version controls gives coders more freedom to explore different paths on how they want to work on their project. If a software engineer wants to try something new or add new functionality to their code, they can freely do so because they have a backup saved. If something goes wrong, where the code fails with no return, we can revert back to our saved checkpoint on Github without any consequences. Github also provides a sense of security for software engineers where we know that we will be able to have backup of our code incase something goes wrong with our local copy on our computer(ex. lost laptop, failed hard drive, etc..)
GitHub also allows coders to collaborate on a project with ease. With the power of “forking” and working on different branches, github allows other coworkers to create a copy of the code without interfering with the original project. You can also fork a project to propose changes to the original repo. To fork a repo, navigate to the repository that you would like on GitHub. On the top right corner, you should see a fork button.

After forking, you will be navigated to the copied repository on your own GitHub account. To work on the repo locally, we have to clone it. First, find the green button named Code. After clicking the button, a menu will pop down with a url.

Copy the url and navigate to terminal(mac) or command prompt(windows). Navigate to the directory where you would like to clone your repo using cd. Once we cd (change directory) into the directory we want, type in “git clone” and paste the url we copied from before.

Now we have a locally working repository that we can work on.
Once we are ready to save/update our repo to GitHub, we can use git add, git commit, and git push. To start, change the working directory to your local repository. To add/update the files that we can to upload, enter git add .

Now our files are almost ready to be uploaded. Next we need to use git commit -m “Add existing file”. Git commit tracks the changes that we made since our last upload. Inside the quotations, it’s best practice to add a message about what you have done since our last commit.

Lastly, type git push and press enter.

Not only does GitHub provides a platform save our own data, it also allows students/coders to freely explore other repositories to learn and expand their knowledge. One of the biggest advantage of an online hosting platform is that it allows anyone from around to work to show their input and learn from each other. GitHub plays a vital part in the growth of the software engineering and the tech community