Skip to content

Instantly share code, notes, and snippets.

@touero
Last active November 19, 2023 14:32
Show Gist options
  • Save touero/d2d54452ed4ec0b50669443c1788c4d9 to your computer and use it in GitHub Desktop.
Save touero/d2d54452ed4ec0b50669443c1788c4d9 to your computer and use it in GitHub Desktop.
How to resolve code conflicts caused by submitting PR on github?

After fork and git clone

fork_url: your forking repo
origin_url: repo forked by you
step.1: Check current origin, it should be fork_url.

git remote -v

step.2: Remove current origin.

git remote remove origin

step.3: Add origin.

git remote add origin origin_url

step.4: Check result origin, it should be origin_url.

git remote -v

step.5: Pull repo.

git pull origin

then resolve conflicts.
step.7: Repeat step.2, 3, 4, it should be fork_url. Then you can commit and push, at this point, they should be pushed to your forking repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment