git checkout -b [yourbranchname] git commit Note: In Git version 2.23, a new command called git switch was introduced to eventually replace git checkout