Skip to content

Instantly share code, notes, and snippets.

@devkabiir
Last active November 26, 2020 08:44
Show Gist options
  • Save devkabiir/64bd63d4879f8bd596bcc21ec48561b3 to your computer and use it in GitHub Desktop.
Save devkabiir/64bd63d4879f8bd596bcc21ec48561b3 to your computer and use it in GitHub Desktop.
Git fork a repo and send PR #git #git-fork #git-pr #git-remote #git-upstream
  1. Fork the repo first
  2. Clone it
  3. Add upstream remote
git remote add upstream <URL>
  1. Fetch the latest changes/commits from upstream
git fetch upstream
  1. Create a new branch for the fix or feature by tracking upstream/master or any upstream branches
git checkout -b my_fix_or_feature --track upstream/master
  1. Make changes/commits

  2. Push to orgin/<branch_name>

    • Optionally force push to origin/<branch_name>
  3. Create PR from github web UI

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