Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 930 Bytes

merge-upstream.adoc

File metadata and controls

47 lines (36 loc) · 930 Bytes

Merge upstream

Pre-requesite: Tracking upstream

Make sure main is clean with no pending modification or unpushed commit.

# Create an upstream branch to merge upstream:
git checkout main
git pull
git checkout -b merge-upstream
git pull upstream main

# Compare branch with `main`
git checkout main
git diff --no-ext-diff main merge-upstream

# Rebase upstream branch to `main` branch if everything is ok then push:
git checkout main
git rebase merge-upstream
git push

# Remove no more used branch
git branch --delete merge-upstream

Using prezto aliases:

# Create an upstream branch to merge upstream:
gco main
gfm
gbc merge-upstream
gfm upstream main

# Compare branch with `main` branc
gco main
gwd main merge-upstream

# Rebase upstream branch to `main` branc if everything is ok then push:
gco main
gr merge-upstream
gp

# Remove no more used branch
gbx merge-upstream