Close Menu
Soshace Digital Blog

    Subscribe to Updates

    Get The Latest News, Updates, And Amazing Offers

    What's Hot
    Startups

    Why Startups Fail? Part 1

    JavaScript

    AI in Recruitment: Cases and Trends

    Programming

    Оценка задачи

    Important Pages:
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    Facebook X (Twitter) Instagram LinkedIn YouTube
    Today's Picks:
    • Scaling Success: Monitoring Indexation of Programmatic SEO Content
    • Leveraging Influencers: Key Drivers in New Product Launches
    • How Privacy-First Marketing Will Transform the Industry Landscape
    • The Impact of Social Proof on Thought Leadership Marketing
    • Balancing Value-Driven Content and Promotional Messaging Strategies
    • Top Influencer Marketing Platforms to Explore in 2025
    • Emerging Trends in Marketing Automation and AI Tools for 2023
    • Strategies to Mitigate Duplicate Content in Programmatic SEO
    Saturday, September 6
    Facebook X (Twitter) Instagram LinkedIn YouTube
    Soshace Digital Blog
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    Services
    • SaaS & Tech

      Maximizing Efficiency: How SaaS Lowers IT Infrastructure Costs

      August 27, 2025

      Navigating Tomorrow: Innovations Shaping the Future of SaaS

      August 27, 2025

      Maximizing Impact: Strategies for SaaS & Technology Marketing

      August 27, 2025
    • AI & Automation

      Enhancing Customer Feedback Analysis Through AI Innovations

      August 27, 2025

      Navigating the Impact of AI on SEO and Search Rankings

      August 27, 2025

      5 Automation Hacks Every Home Service Business Needs to Know

      May 3, 2025
    • Finance & Fintech

      Critical Missteps in Finance Marketing: What to Avoid

      August 27, 2025

      Analyzing Future Fintech Marketing Trends: Insights Ahead

      August 27, 2025

      Navigating the Complex Landscape of Finance and Fintech Marketing

      August 27, 2025
    • Legal & Compliance

      Exploring Thought Leadership’s Impact on Legal Marketing

      August 27, 2025

      Maximizing LinkedIn: Strategies for Legal and Compliance Marketing

      August 27, 2025

      Why Transparency Matters in Legal Advertising Practices

      August 27, 2025
    • Medical Marketing

      Enhancing Online Reputation Management in Hospitals: A Guide

      August 27, 2025

      Analyzing Emerging Trends in Health and Medical Marketing

      August 27, 2025

      Exploring Innovative Content Ideas for Wellness Blogs and Clinics

      August 27, 2025
    • E-commerce & Retail

      Strategic Seasonal Campaign Concepts for Online and Retail Markets

      August 27, 2025

      Emerging Trends in E-commerce and Retail Marketing Strategies

      August 27, 2025

      Maximizing Revenue: The Advantages of Affiliate Marketing for E-Commerce

      August 27, 2025
    • Influencer & Community

      Leveraging Influencers: Key Drivers in New Product Launches

      August 27, 2025

      Top Influencer Marketing Platforms to Explore in 2025

      August 27, 2025

      Key Strategies for Successful Influencer Partnership Negotiations

      August 27, 2025
    • Content & Leadership

      The Impact of Social Proof on Thought Leadership Marketing

      August 27, 2025

      Balancing Value-Driven Content and Promotional Messaging Strategies

      August 27, 2025

      Analyzing Storytelling’s Impact on Content Marketing Effectiveness

      August 27, 2025
    • SEO & Analytics

      Scaling Success: Monitoring Indexation of Programmatic SEO Content

      August 27, 2025

      Strategies to Mitigate Duplicate Content in Programmatic SEO

      August 27, 2025

      Effective Data Visualization Techniques for SEO Reporting

      August 27, 2025
    • Marketing Trends

      How Privacy-First Marketing Will Transform the Industry Landscape

      August 27, 2025

      Emerging Trends in Marketing Automation and AI Tools for 2023

      August 27, 2025

      Maximizing ROI: Key Trends in Paid Social Advertising

      August 27, 2025
    Soshace Digital Blog
    Blog / Git / Understanding The GIT Workflow
    Git

    Understanding The GIT Workflow

    Gaurav KukadeBy Gaurav KukadeJanuary 27, 2020Updated:July 31, 2020No Comments12 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Understanding The GIT Workflow
    Understanding The GIT Workflow
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link
    Understanding The GIT Workflow
    Understanding The GIT Workflow

    Nowadays, GIT has become an integral part of the software development process.

    GIT is a distributed version control system to track changes in software development.

    But how developers use GIT to track changes in day to day life?

    In this article, we are going to learn the GIT workflow. I will explain to you a simple GIT workflow developers use to track the changes and maintain the clean GIT history.

    I will tell you my story: what actions I performed after my team leads assigned me a new task.

    I have recently become a part of a team of 10 developers. Soon after, my team lead asked me to add a new feature to the application.

    Other developers were also working on their tasks simultaneously, maybe some features or bug fixes.

    I have listed down all the steps that I performed. From now, I’ll write everything in the present tense.

    Actions:

    1. Clone the repository
    2. git fetch and git rebase
    3. Create a new branch
    4. Add commits
    5. git fetch and git rebase (on the master branch)
    6. Push the commits
    7. Create a Pull Request
    8. Discuss, review and merge pull request

    The following diagram shows the complete git workflow

    The Git Workflow
    The Git Workflow

    Now we will see all these steps one by one in detail with its workflow diagram

    1. Clone the repository

    I have become a part of the new team.

    My team leads discussed the new feature with me and asked me to work on it.

    What will be the first step? Of course, my first step will be cloning the application repository from the GIT hosting platform on my computer.

    Cloning the repository means; you are downloading the available repository from the GIT hosting platform to work on it.

    We will consider GITHUB as our GIT hosting platform.

    How do I clone my repository?

    We can use the git command git clone and the GitHub repository URL to clone it on my computer.

    The following command clones the repository in the current directory.

    $ git clone <your-github-repository-url>

    I have created a simple GitHub repository for this tutorial. The following image shows you the repository URL to use for cloning.

    Showing the GitHub repository URL
    Showing the GitHub repository URL

    The following GIF shows how to clone a repository.

    Cloning a git repository
    Cloning a git repository

    The following diagram shows the workflow for step 1 Clone the repository

    Step 1 Clone the repository
    Step 1 Clone the repository

    2. git fetch and git rebase

    What does it mean by these commands?

    Instead of learning the commands directly, let us understand the concept.

    Always start your new work on the tip of the master branch. But what if your team lead merged other commits with the master after you cloned the repository on your computer. Hence we are performing this step as precaution.

    To avoid this issue, you should check if there are any new commits on the remote repository.

    git fetch does the same thing. It will download all the commits, files, and references from the remote repository to your local repository.

    Now I can see what my other team members have worked on while I was doing my setup.

    GIT isolates the fetched commits from the local commits. You can review these changes and decide to merge them into your local repository or not.

    If you decide to not merge the downloaded commits into your local repository, you can use the git checkout command to check out the commits explicitly.

    Nothing will be downloaded if there are no changes in the remote repository, but you will get assurance that you are starting your work on the tip of the master.

    By using the following command, you can fetch the commits from the remote repository.

    $ git fetch

    As you knew, git fetch only downloads the commits from the remote repository to the local repository. It does not merge these commits with the local repository.

    So, we use our next command, git rebase.

    This command will combine the sequence of new commits (commits received from the remote repository) to the base commits (your local master branch).

    $  git rebase

    The following GIF shows the fetching and rebasing your local branch with new downloaded commits from remote repository

    Read More:  Overview of Basic Data Structures: How to Organize Data the Efficient Way
    Executing git fetch and git rebase commands in git bash
    Executing git fetch and git rebase commands in git bash

    Now I have the local master branch, with all the latest commits and you can start working on your new feature.

    Before moving towards the next step, we will see one more way to fetch and rebase the commits.

    It is git pull command.

    This command will download the content as well as merge it into the local branch. It is a more aggressive alternative to the git fetch command.

    I will not be able to review the downloaded changes. So, when I am not sure about what other developers are working on, it is not recommended to use this command.

    You can consider git fetch and git rebase a ‘safe’ version for this purpose.

    The following diagram shows the workflow for step 2 git fetch and git rebase

    Step 2 git fetch and git rebase
    Step 2 git fetch and git rebase

    3. Create a new branch

    Branching concepts exists to manage the workflow.

    When you create a new branch locally, you are creating a new environment to try out new ideas. Things you change here will not affect the master branch.

    So, I will create a new branch for the task assigned to me.

    The following command creates a new branch locally.

    $ git checkout -b <your-new-branch-name>

    The following GIF shows you how to create a new branch.

    Create a new branch locally
    Create a new branch locally

    You should create a new branch for a feature.

    Naming your GIT branch

    There are many GIT branch naming conventions. The GitHub refers to simple descriptive branch naming.

    On Atlassian’s Git tutorials they have suggested the following ways,

    How to name your supporting branch prefixes?
    Feature branches? [feature/]
    Release branches? [release/]
    Hotfix branches? [hotfix/]
    Support branches? [support/]

    I think these prefixes with the forward-slash help you to categories your branches easily.

    The naming convention can be different in your organization.

    Since my team lead has assigned me a task related to the new feature, I will name my branch feature/my-new-feature-short-description .

    The following diagram shows the workflow for step 3 Create a new branch

     Step 3 Create a new branch
    Step 3 Create a new branch

    4. Add commits

    Now I have my local branch dedicated to the feature. I will make the required changes to add it.

    Once I have done the changes, I will check if everything is working fine. If the feature assigned by the team lead is working fine, I will be ready to add the commit.

    You already know how to commit the changes. If you do not know, don’t worry, I am explaining it below.  If you like to know it in more detail, consider visiting this tutorial.

    You can commit the changes in two steps.

    The first step is to stage the changes to commit using the git add command. You can add multiple files at a single time, separating their name by space.

    The last step is to commit the changes using the git commit command. Please remember to give a descriptive message to your commit.

    The following commands show staging and committing you changes

    $ git add <your-new-feature-file> <your-new-feature-file-2>
    
    $ git commit -m "Add <feature-name> new feature"

    You can view the current status of the commit process by git status command.

    The following GIF will show you how to commit the changes I have done for adding a new feature.

    Adding commits
    Adding commits

    The following diagram shows the workflow for step 4 Add commits

    Step 4 Add commits
    Step 4 Add commits

    5. git fetch and git rebase (on the master branch)

    Now, you will think why do we have to perform these commands again?

    We have learned the concepts behind the git fetch and git rebase in the second step.

    We do execute these commands to download the commits by other team members to the remote repository and merge them into the local repository.

    I will execute the following command to check out to the master branch from my current branch (feature branch).

    $ git checkout master
    

    Then I will execute the following commands one by one to download all commits from my other team members to the remote repository.

    $ git fetch 
    
    $ git rebase
    

    Now I have the latest local master branch and your new branch with the commits.

    I will check out to my feature branch using the following command.

    $ git checkout feature/my-new-feature-short-description
    

    I will perform the following command, and it will add all the extra commits from the master branch to the current branch (my feature branch).

    $ git rebase master

    Now my feature branch has all the commits from the latest master branch on the remote repository and the commits I have made for adding my new feature.

    Read More:  The Role of Microservices in Modern Software Development

    The following the GIF shows the above commands.

    git fetch and git rebase on the master branch
    git fetch and git rebase on the master branch

    So, I am ready to push my changes to the GitHub.

    The following diagram shows the workflow for step 5 git fetch and git rebase (on the master branch)

    Step 5 git fetch and git rebase (on the master branch)
    Step 5 git fetch and git rebase (on the master branch)

    6. Push the commits

    Now you can push your changes to the GitHub using the git push command.

    If your local branch does not exist on the remote platform, the git push command push all your local branch into the platform.

    The following commands push your current branch/changes to the GitHub.

    $ git push origin feature/my-new-feature-short-description
    

    here origin is the remote repository it is pointing to.

    The following GIF shows how to push the code.

    Pushing the commits to remote branch
    Pushing the commits to remote branch

    The following diagram shows the workflow for step 6 Push the commits

    Step 6 Push the commits
    Step 6 Push the commits

    7. Create a pull request

    When you push your changes to the GitHub, you can see the following button on your GitHub repository,

    Showing compare and create pull request button
    Showing compare and create pull request button

    Click on the create a pull request, it will open a dialog.

    Create a pull request dialog
    Create a pull request dialog

    Here you are comparing your branch with the master branch.

    You can add a title to your pull request and add a description of what changes will happen to the application if this pull request merged.

    Also, I can assign this to pull request to my team lead so that we can discuss and review the changes.

    The following GIF show how to create a pull request on GitHub.

    create a pull request on GitHub
    create a pull request on GitHub

    The following diagram shows the workflow for step 7 Create a Pull Request

    Step 7 Create a Pull Request
    Step 7 Create a Pull Request

    8. Discuss, review and merge pull request

    Discussion and reviewing your code is one of the most important steps of the git workflow.

    When your team leads reviews your code he can give his valuable suggestions and tips which will help you next time.

    GitHub provides special features to review the code of the pull request. The team lead can add comments to the specific line of code so that you can refer to it later on.

    Once all things are fine, the team lead will merge your pull request.

    The following diagram shows the workflow for step 8 Discuss, review and merge pull request

    Step 8 Discuss, review and merge pull request
    Step 8 Discuss, review and merge pull request

    Conclusion

    In this article, we have learned the simple git workflow.

    First, you have to clone the repository locally. Please do not forget to fetch and rebase since there are chances that other developers can merge commits to the remote repository after you cloned it on your local computer.

    Always create a new branch for a new feature. After making the required changes on the new branch, commit the changes.

    Please, do not forget to fetch and rebase on the master. Always push your feature branch with all the commits from the current remote master branch as well as local commits from your feature branch. ‘Fetch and rebase on the master’ step will help you achieve the same.

    Once you pushed your branch to the GitHub, it will provide you a nice UI where you can edit your commit message as title and write a description for your pull request. Also, you can assign the pull request to team lead and add reviewers to review your code.

    Finally, create a pull request and discuss your code with your team lead. He may provide you some tips and suggestions, which will help you next time.

    Do not shy, feel free to ask your team lead, if you have any query about the code.

    Your team lead will merge your pull request if he found everything OK and your code will be added to the master branch.

    Its time to enjoy. Happy coding!

    What do you think about the above git workflow?

    If you follow some other practices at your organization and have tips please write down in the comment section below.

    git git workflow
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Gaurav Kukade

      Related Posts

      Mastering REST APIs: Essential Techniques for Programmers

      December 18, 2024

      Crafting Interactive User Interfaces Using JavaScript Techniques

      December 17, 2024

      Effective Strategies for Utilizing Frameworks in Web Development

      December 16, 2024
      Leave A Reply Cancel Reply

      You must be logged in to post a comment.

      Stay In Touch
      • Facebook
      • Twitter
      • Pinterest
      • Instagram
      • YouTube
      • Vimeo
      Don't Miss
      Blogs June 28, 2019

      16 Best Web Development & Web Design Blogs

      If you’re looking for new people or blogs to follow, then this article will certainly throw in some ideas on the latest (and sometimes oldest but, nevertheless, regularly updated) resources on web development and design.

      Interview with Alexander

      September 13, 2017

      How to Prepare for Your First Coding Job Interview?

      January 23, 2020

      Operating Systems Showdown: Windows vs. macOS vs. Linux for Web Development

      July 10, 2019

      Categories

      • AI & Automation
      • Angular
      • ASP.NET
      • AWS
      • B2B Leads
      • Beginners
      • Blogs
      • Business Growth
      • Case Studies
      • Comics
      • Consultation
      • Content & Leadership
      • CSS
      • Development
      • Django
      • E-commerce & Retail
      • Entrepreneurs
      • Entrepreneurship
      • Events
      • Express.js
      • Facebook Ads
      • Finance & Fintech
      • Flask
      • Flutter
      • Franchising
      • Funnel Strategy
      • Git
      • GraphQL
      • Home Services Marketing
      • Influencer & Community
      • Interview
      • Java
      • Java Spring
      • JavaScript
      • Job
      • Laravel
      • Lead Generation
      • Legal & Compliance
      • LinkedIn
      • Machine Learning
      • Marketing Trends
      • Medical Marketing
      • MSP Lead Generation
      • MSP Marketing
      • NestJS
      • Next.js
      • Node.js
      • Node.js Lessons
      • Paid Advertising
      • PHP
      • Podcasts
      • POS Tutorial
      • Programming
      • Programming
      • Python
      • React
      • React Lessons
      • React Native
      • React Native Lessons
      • Recruitment
      • Remote Job
      • SaaS & Tech
      • SEO & Analytics
      • Soshace
      • Startups
      • Swarm Intelligence
      • Tips
      • Trends
      • Vue
      • Wiki
      • WordPress
      Top Posts

      Maximizing LinkedIn Engagement: Leveraging Video Content

      LinkedIn November 28, 2024

      Code Style

      Programming January 11, 2016

      Transforming LinkedIn Connections into Viable Sales Leads

      LinkedIn November 25, 2024

      Angular 2, part 2

      Programming August 26, 2016

      Subscribe to Updates

      Get The Latest News, Updates, And Amazing Offers

      About Us
      About Us

      Soshace Digital delivers comprehensive web design and development solutions tailored to your business objectives. Your website will be meticulously designed and developed by our team of seasoned professionals, who combine creative expertise with technical excellence to transform your vision into a high-impact, user-centric digital experience that elevates your brand and drives measurable results.

      7901 4th St N, Suite 28690
      Saint Petersburg, FL 33702-4305
      Phone: 1(877)SOSHACE

      Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
      Our Picks
      LinkedIn

      Establishing Expertise on LinkedIn to Attract Prospective Clients

      Machine Learning

      Unsupervised Sentiment Analysis using VADER and Flair

      Programming

      Стиль кода

      Most Popular

      Работа с заказчиком

      Wiki

      Markdown Cheat Sheet: Definitive Guide to Markdown + Markdown Resources

      Beginners

      Strategic LinkedIn Tactics for E-Commerce Lead Generation

      LinkedIn
      © 2025 Soshace Digital.
      • Home
      • About
      • Services
      • Contact Us
      • Privacy Policy
      • Terms & Conditions

      Type above and press Enter to search. Press Esc to cancel.