Use the Terminal and Find Git Command Help
Terminal, shell and working directory
A terminal is an interface for entering commands; a shell reads those commands and starts programs. The current working directory is the folder the shell is currently using. Git often acts on the repository containing that directory. Use Bash (Git Bash on Windows) for the shell examples in this course. Do not copy the prompt symbol if your terminal displays one.
Make a safe practice folder
Open a folder you own that is outside any existing Git project. Create a new folder named bytemind-git-lab, then enter it. If that name already exists, stop and choose a different unused name; do not enter an existing project. mkdir creates a directory, cd changes the current directory and pwd prints its path. The path varies by machine. Keep this terminal open for the next lesson.
Read a Git command
In git init -b main, git is the program, init is its subcommand, -b is an option, and main is the value of that option. You will execute this in the next lesson. For now, ask Git for a brief usage summary: -h is supported by init. It may report a nonzero exit status even when it successfully displays help.
Find more detailed documentation
Use git help for an overview or git help init for detailed documentation. The detailed manual may open in a viewer, depending on your installation; if a terminal pager opens, q normally closes it. If manual pages or a viewer are missing, use the official reference at https://git-scm.com/docs and select documentation for your client version. Help commands do not initialize your project.
Practice
Without creating a repository yet, locate the option in git init -h that selects an initial branch. Explain the difference between cd and git init. Before the next lesson, confirm with pwd that you are in your newly created practice folder.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Use the Terminal and Find Git Command Help — knowledge check
Apply the lesson to common beginner scenarios.
Which command prints your current working directory in Bash?
What does cd do?
In git init -b main, what is main?
How can you see a short usage summary for init without initializing a repository?
The chosen practice folder already exists. What should you do?