How to Merge Branch to Master GitHub | Scribe

    How to Merge Branch to Master GitHub

    • |
    • 0 step |
    • 2 minutes
      Open your Terminal or Command Prompt and navigate to the Repository containing the branch you would like to merge.
      Type "git branch [[Enter]]" to display a list of all branches. You'll have to switch to the branch you want to merge into to successfully merge. To do this, enter the following commands:
      Type "git add _a [[Enter]]" to add a branch to the staging area.
      Type "git commit -m "commit message" [[Enter]]" To add the commit message.
      Type "git checkout main [[Enter]]" To run a Git Checkout to switch to your main branch.
      If the branch you would like to merge is behind your main branch, you'll need to do a fast-forward to catch up. To do this, Type "git pull [[Enter]]"
      Now, you can merge your branch into the main branch. Simply type "git merge second-branch [[Enter]]"
      Was this Scribe helpful?
      Save this document for future reference.
      This Scribe is in tip-top shape!Leave feedback if there are any issues with this Scribe