Skip to content

Invalid Git Command Syntax in resetting-a-branch.mdΒ #128704

Open

Description

@Adil-Khan-N

🐞 Problem

In `docs/additional-material/git_workflow_scenarios/resetting-a-branch.md`, lines 9–17 provide an invalid Git syntax:
`git reset <base_branch> <origin_branch>` and `git reset stage master --hard`.

Running this command causes Git to throw an error (`fatal: ambiguous argument 'stage': unknown revision or path not in the working tree`). `git reset` cannot take two branch names
as positional arguments because it always acts on `HEAD`.

🎯 Goal

Provide beginners with accurate, working Git commands to reset a local branch to match another branch.

πŸ’‘ Possible solutions

Update the tutorial to show checking out / switching to the base branch first before running `git reset --hard <target_branch>`.

πŸ“‹ Steps to solve the problem

- [ ] Create a branch `fix/reset-branch-command-syntax`.
- [ ] Update `resetting-a-branch.md` with accurate commands.
- [ ] Submit a pull request.

Activity

  1. Adil-Khan-N commented on Nov 19, 2026

    @Adil-Khan-N
    ContributorAuthor

    I would like to take up this. \

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions