Skip to content

Instantly share code, notes, and snippets.

Avatar

Flo aequi42

  • Quanos GmbH
  • Germany
View GitHub Profile
@ravibhure
ravibhure / git_rebase.md
Last active Apr 22, 2021
Git rebase from remote fork repo
View git_rebase.md

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream