Skip to content

docs: correct invalid git reset branch syntax in resetting-a-branch.md - #128705

Open
Adil-Khan-N wants to merge 1 commit into
firstcontributions:mainfrom
Adil-Khan-N:fix-reset-branch-syntax
Open

Adil-Khan-N wants to merge 1 commit into
firstcontributions:mainfrom
Adil-Khan-N:fix-reset-branch-syntax

Conversation

@Adil-Khan-N

Copy link
Copy Markdown
Contributor

Solves #128703

In docs/additional-material/git_workflow_scenarios/resetting-a-branch.md, lines 9–17 instruct users:

git reset <base_branch> <origin_branch>

With the example:

git reset stage master --hard

git reset does not accept two branch arguments. Running git reset stage master --hard in Git fails with:

fatal: ambiguous argument 'stage': unknown revision or path not in the working tree.

In Git, git reset always operates on the currently checked-out branch (HEAD). To reset a branch like stage to match master, the user must first switch to that branch and then reset it
to the target commit or branch (git checkout stage && git reset --hard master). Alternatively, git branch -f can force-update a branch reference.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant