Skip to content

Instantly share code, notes, and snippets.

@threeiem
Created December 14, 2020 04:51
Show Gist options
  • Save threeiem/b3c38901b50a816133465384f89666d5 to your computer and use it in GitHub Desktop.
Save threeiem/b3c38901b50a816133465384f89666d5 to your computer and use it in GitHub Desktop.
Updating a Feature Branch Using Merge

Updating a Feature Branch Using Merge

Updating main

Update the local main branch.

git checkout main

Fetch the remote using -p or --prune option to remove nonexistant remote-tracking references. This stores commits to main in a local branch, remotes/origin/master

git fetch -p origin

Merge changes from origin/main into the local main branch. Now the main branch in up to date with the remote. If there are no commits, git will perform a "fast-forward".

git merge origin/main

Updating the Feature Brach

Check out the feature branch (ex. feature-117-xaml-update).

git checkout feature-117-xaml-update

Merge the updated main branch into the feature branch.

git merge main

Send Changes to Remote

Push changes to the remote.

git push origin feature-117-xaml-update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment