I tried looking for a special Git command for this, but I couldn't find one. Is there anything shorter or faster than the following?
git branch | awk '/\*/ { print $2; }'
In order to checkout a new branch from a specific start point, you have to execute the “git checkout” command and specify the “-B” option, as well as the branch and its start point.
$ git rev-parse --abbrev-ref HEAD master
This should work with Git 1.6.3 or newer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With