git branch --force <branch-name> [<new-tip-commit>]
If new-tip-commit
is omitted, it defaults to the current commit.
new-tip-commit
can be a branch name (e.g., master, origin/master).
More Related Contents:
- How do I rename a local Git branch?
- How do I push a new local branch to a remote Git repository and track it too?
- Move existing, uncommitted work to a new branch in Git
- Git fetch remote branch
- Showing which files have changed between two revisions
- Branch from a previous commit using Git
- How to replace master branch in Git, entirely, from another branch? [duplicate]
- How to fetch all Git branches
- What is the difference between origin and upstream on GitHub?
- Deleting a badly named git branch
- Remove tracking branches no longer on remote
- Rename master branch for both local and remote Git repositories
- Cleaning up old remote git branches
- Difference between git checkout –track origin/branch and git checkout -b branch origin/branch
- Git: Find the most recent common ancestor of two branches
- How do I safely merge a Git branch into master?
- How to add Git’s branch name to the commit message?
- How do I get the current branch name in Git?
- View a file in a different Git branch without changing branches
- How to determine when a Git branch was created?
- How can I clone all remote branches?
- What are the differences between local branch, local tracking branch, remote branch and remote tracking branch?
- What is the difference between “git branch” and “git checkout -b”?
- Git branch strategy for small dev team [closed]
- git how to find commit hash where branch originated from
- Git: track branch in submodule but commit in other submodule (possibly nested)
- How to ‘git pull’ into a branch that is not the current one?
- Git: How to list commits on this branch but not from merged branches
- Git merge branch into master
- Commit a file to a Different Branch Without Checkout