Challenge¶
- Create a directory named
softball/
- Initialize a git repo inside it.
- By default, the initial branch will be named
main
. Name itbooger
instead.
Solution¶
Explanation¶
-
cd
(change directory) into~/Desktop/
-
mkdir
(make directory)softball/
. -
cd
intosoftball/
, since that's where we want the git repo to live. -
Initialize the git repo with
git init
.The
--initial-branch
flag lets us name the initial branch name something other thanmain
(the default name).
How do I change the initial branch name after creating it?
You can rename the current branch using git branch -m <newname>
. So,
could also be accomplished by
git help
You can use
git <command> -h
to see how to use a git command orgit help <command>
to read the full docs regarding the command.