TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    Git

    What is Branching?

    What is Branching?

    Branching is what happens when you want to work on multiple features at the same time. You wouldn’t want to end up with a master branch that has Feature 1 half done and Feature 2 half done. Furthermore, we would separate the code base into “snapshots” (branches) and work on and commit to them separately. As soon as we are ready, we might merge this branch back into the master branch and push it to the remote server.

    When developers are working on a feature or bug they’ll often create a branch of their code they can make separate commits to. Then when they’re done they can merge this branch back into their main master branch.

    branching

     

    Creating a branch

    /> git branch <branch_name>

    We can switch branches using the git checkout <branch> command. You can also use -b to do both the things together( create a branch and checkout ):

    /> git checkout -b new_branch

    https://www.testingdocs.com/create-a-git-branch/

    What is a pull request?

    A pull request allows the project owner or code reviewer to look through your changes and make comments before deciding to merge in the change. It’s a really great feature that is used all the time for remote workers and open-source projects.

    https://www.testingdocs.com/create-a-pull-request/

     

    Pull Request

    Git merge:

    We might want to merge the changes from the branch into the master branch. Something like below, when you are on the master branch. Telling Git to merge the <branch_name>

    /> git merge <branch_name>

    Merge Conflicts can occur when changes are made to a file at the same time. When merge conflicts, we just need to decide which code to keep. There are tools to help to resolve merge conflicts.

    https://www.testingdocs.com/resolving-merge-conflicts-on-github/

    Delete a branch:

    We can use the below command to delete a branch. For example to clean bug_fix branch :

    /> git branch -d <branch name>

    /> git branch -d bug_fix

    Related Posts

    Git Install on Linux

    Git /

    Install Git on Ubuntu Linux

    Version_Control_Centralized

    Git /

    Overview of Version Control Systems

    Git Website

    Git /

    Getting Started with Git Version Control

    Install Git on Windows 10

    Git /

    Install Git on Windows 10

    Git Bash App

    Git /

    Set Up Git Bash On Windows 10

    ‹ Install Git on Ubuntu Linux

    Recent Posts

    • ChatGPT Subscription Plans
    • Stellar Converter for Database
    • Stellar Log Analyzer for MySQL
    • Stellar Repair for MySQL
    • ChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI Features
    • Shaping the Future of Development: Exploring Key Trends in Software Engineering
    • Improving Java Performance with Multithreading
    • Open-source Vector Databases

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com