Skip to main content
Changed -f to --force. Added that new-tip-commit can be a branch name.
Source Link
Nathan
  • 8.5k
  • 9
  • 52
  • 80
git branch -f-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).

git branch -f <branch-name> [<new-tip-commit>]

If new-tip-commit is omitted it defaults to the current commit.

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).

explain second param is optional
Source Link
Brian Burns
  • 21.5k
  • 10
  • 90
  • 78
git branch -f <branch-name> <new[<new-tip-commit>commit>]

If new-tip-commit is omitted it defaults to the current commit.

git branch -f <branch-name> <new-tip-commit>
git branch -f <branch-name> [<new-tip-commit>]

If new-tip-commit is omitted it defaults to the current commit.

Signify place holders with `<` and `>`.
Source Link
git branch -f branch<branch-namename> new<new-tip-commitcommit>
git branch -f branch-name new-tip-commit
git branch -f <branch-name> <new-tip-commit>
Rollback to Revision 1
Source Link
Chris Johnsen
  • 221.2k
  • 26
  • 212
  • 187
Loading
added 114 characters in body
Source Link
knocte
  • 17.6k
  • 12
  • 83
  • 131
Loading
Source Link
Chris Johnsen
  • 221.2k
  • 26
  • 212
  • 187
Loading