01 logo

Git | GitHub and Version Control

The better you understand it, the better you will get with it.

By Utkarsh YadavPublished 3 years ago 3 min read
1
Version Control Pipeline

Content

  • Introduction ( Terminologies )
  • Understanding the GitHub Work-Flow
  • What’s Open Source
  • Make your first Contribution.
  • Introduction

Git

Git is a version-control system for tracking changes in computer files and coordinating work on those files among multiple people. Git is a distributed-version control system. Git does rely on a central server to store all the versions of a project’s files. Instead, every user “Clones” a copy of a repository and has the full history of the changed that had been tracked before.

GitHub

GitHub is a Code hosting platform for version control collaboration. GitHub is a company that allows you to host a central repository in a server.

I think you are now pretty clear about.

  • What is git.
  • What is GitHub. and how it is different from git.
  • Version Control.

Understanding the GitHub Work-Flow

(Dive into how GitHub works?)

Let me Explain you with some UML Diagrams…

Create a Branch

Branch creation pipeine

When you have one project and different ideas, Branch creation comes into play you can work with different ideas in Different branches.

When you create a branch in your project, you’re creating an environment where you can try out new ideas. Change you make into the current working branch do not affect the master branch i.e base branch. The current working branch is safe to be modify and use and will not be merge until the maintainer of that project reviews and merge it with master branch.

Creating a branch when raising PR’s

git checkout -b <Your username>/<Branch-name>

Add commits

Commit creation pipeine

When you have successfully created your branch, you can now make changes. whenever you make a change like deleting, modification, additions etc. you make a commit, and adds the changes to the working branch. This commit addition keeps track of the changes you make on the working branch.

Most interesting part is whenever you dealt with Bugs 🐛🐛 , You can roll back to previous committed changes. and can decide easily in which direction you want to move on. See such an easy project management dope level stuff it is.

Command for Commit

git commit -m "<Your message Goes Here>"

Open Pull request

Pull Request pipeine

Pull request is somewhat saying that Hey maintainer may I contribute to your project, I have made some changes which is good to merge into your project, Kindly have a look.

So, Here you can open a Pull Request at any point during the development. and when you make your pull request and compare it you dealt with a message block. It’s a good practice to make it more confirming by Commenting maintainer, that what’s in it? and how one can overcome the Bug, or any issue.. Mention the GitHub’s User by @<Username> and You done here…

Discuss | Review code (Best practice is to interact)

Dicussion on refactoring Code pipeline

Once a Pull Request has been opened, the person or team reviewing your changes may have questions. might be possible that the coding style doesn’t match project’s guidelines, the changes missing unit tests. Pull Requests are designed to encourage and capture this type of conversation.

If someone comments that you forgot to do something or if there is a bug in the code, you can fix it in your branch and push up the change back to fire. GitHub will show your new commits and any additional feedback you may receive in the unified Pull Request view.

Deploy

Deploying Code to the Production/test for final testing

With GitHub, you can deploy from a branch for final testing in production before merging to master.

Once your pull request has been reviewed and the branch passes your tests, you can deploy your changes to verify them in production. If your branch causes issues, you can roll it back by deploying the existing master into production. As mentioned earlier…

Merge

Merging pipeline

Now that your changes have been verified in production, it is time to merge your code into the master branch.

Once merged, Pull Requests preserve a record of the historical changes to your code. Because they’re searchable, they let anyone go back in time to understand why and how the changes were made.

Glad to tell you doing above you made your first contribution to an open source world.

Hope you like this post.

how to
1

About the Creator

Utkarsh Yadav

Hello Vocal,

I am Utkarsh, Content creator on vocal, writing Technical articles and help people understand things better than ever.

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.