cours/git create branch from commit.md
Oscar Plaisant 602a41e7f8 update
2024-12-25 22:30:24 +01:00

17 lines
390 B
Markdown

---
alias: "create branch from commit"
name: "create branch from commit"
---
up::[[Git Branches]]
title::"`git checkout -b <branch_name> <commit_sha>`"
title::"`git branch <branch_name> <commit_sha>`"
#s/informatique
----
```bash
$> git checkout -b <branch_name> <commit_sha> # create and switch to the new branch
$> git branch <branch_name> <commit_sha> # create but don't switch
```