Skip to content

Instantly share code, notes, and snippets.

@cfpenton
cfpenton / gist:87d58b4ae36267c520b3959cddd6b47a
Created March 29, 2023 13:08 — forked from seLain/gist:8bdf12c7196f3fccafdf067dec2696b2
Fix the thing GitHub keeps saying “This branch is X commits ahead, Y commits behind”
ref stackoverflow:
https://stackoverflow.com/questions/41283955/github-keeps-saying-this-branch-is-x-commits-ahead-y-commits-behind
works by
1. git remote add upstream https://github/upstream/repo.git
2. git pull --rebase upstream master
2.1 git rebase --skip (if the conflicts are not true, skip the patches)
3. git push --force-with-lease origin master
If there are branches to fix