Git and SSH

Merge a branch into main

Bring the finished work from your branch back into the main version.

Fill these in once
  1. Switch to main
    Terminal
    git switch main
  2. Get the latest main
    Terminal
    git pull

    Skip this if the project isn't on GitHub yet.

  3. Merge your branch in
    Terminal
    git merge fix-login-button

    If Git says there's a conflict, see “Fix a merge conflict”.

  4. Share it on GitHub
    Terminal
    git push

Check it worked

  1. See the history
    Terminal
    git log --oneline --graph -10
Undo it
  1. Stop a merge that's gone wrong
    Terminal
    git merge --abort

    Works while the merge is still in progress. Everything goes back to how it was.

  1. Switch to main
    Terminal · Ubuntu / Debian
    git switch main
  2. Get the latest main
    Terminal · Ubuntu / Debian
    git pull

    Skip this if the project isn't on GitHub yet.

  3. Merge your branch in
    Terminal · Ubuntu / Debian
    git merge fix-login-button

    If Git says there's a conflict, see “Fix a merge conflict”.

  4. Share it on GitHub
    Terminal · Ubuntu / Debian
    git push

Check it worked

  1. See the history
    Terminal · Ubuntu / Debian
    git log --oneline --graph -10
Undo it
  1. Stop a merge that's gone wrong
    Terminal · Ubuntu / Debian
    git merge --abort

    Works while the merge is still in progress. Everything goes back to how it was.

  1. Switch to main
    PowerShell
    git switch main
  2. Get the latest main
    PowerShell
    git pull

    Skip this if the project isn't on GitHub yet.

  3. Merge your branch in
    PowerShell
    git merge fix-login-button

    If Git says there's a conflict, see “Fix a merge conflict”.

  4. Share it on GitHub
    PowerShell
    git push

Check it worked

  1. See the history
    PowerShell
    git log --oneline --graph -10
Undo it
  1. Stop a merge that's gone wrong
    PowerShell
    git merge --abort

    Works while the merge is still in progress. Everything goes back to how it was.

New to Merge? I explain it in plain English on Layman Terms.