Skip to content

Missing git command in pull request step-by-step guide #509

Closed
@zthompson47

Description

@zthompson47

Hello,

I was following the pull request (PR) step-by-step guide from #103 and ran into an error with a git command. My PR has to do with a typo I found in the cpython documentation, and here are the steps to recreate the situation:

  1. Begin at https://devguide.python.org/docquality/#helping-with-documentation-issues
  2. Click "Quick Guide to Pull Requests" link
  3. Click "got the source code" link
  4. Follow instructions to fork, clone, and add upstream for cpython.git
(/tmp)$ git clone git@github.com:zthompson47/cpython.git
Cloning into 'cpython'...
remote: Enumerating objects: 757754, done.
remote: Total 757754 (delta 0), reused 0 (delta 0), pack-reused 757754
Receiving objects: 100% (757754/757754), 284.00 MiB | 2.60 MiB/s, done.
Resolving deltas: 100% (608403/608403), done.
Checking out files: 100% (4307/4307), done.
(/tmp)$ cd cpython 
(/tmp/cpython)$ git remote add upstream git@github.com:python/cpython.git
(/tmp/cpython)$ git remote -v
origin  git@github.com:zthompson47/cpython.git (fetch)
origin  git@github.com:zthompson47/cpython.git (push)
upstream        git@github.com:python/cpython.git (fetch)
upstream        git@github.com:python/cpython.git (push)
  1. Go back to https://devguide.python.org/pullrequest/#step-by-step-guide
  2. Try to "Create a new branch in your local clone"
(/tmp/cpython)$ git checkout -b new-local-branch upstream/master
fatal: 'upstream/master' is not a commit and a branch 'new-local-branch' cannot be created from it

I fixed the error by running git fetch upstream and repeating step six from above to create the branch. I'm no git expert, but I think the "Create a new branch in your local clone" could also just be git checkout -b <branch-name> as the upstream/master and local master branches should refer to the same commit at this point in the process.

I'm happy to submit a PR if warranted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions