Appendix B: Command Quick Reference

[ Appendix B ]

Command Quick Reference

Chapter 1

clear

Clear the command line screen

pwd

Show the path of the current working directory

ls

List visible files and directories

ls -a

List hidden and visible files and directories

cd <path_to_directory>

Change directory

mkdir <directory_name>

Make a directory

git config --global --list

List the variables in the global Git configuration file and their values

git config --global user.name "<name>"

Set your name in the global Git configuration file

git config --global user.email "<email>"

Set your email address in the global Git configuration file

Chapter 2

git init

Initialize a Git repository

git init -b <branch_name>

Initialize a Git repository and set the name for the initial branch to be <branch_name>

Chapter 3

git status

Show the state of the working directory and the staging area

git add <filename>

Add one file to the staging area

git add <filename> <filename> ...

Add multiple files to the staging area

git add -A

Add all the files in the working directory that have been edited or changed to the staging area

git commit -m "<message>"

Create a new commit with a commit message

git log

Show a list of commits in reverse chronological order

Chapter 4

git branch

List local branches

git branch <new_branch_name>

Create a branch

Get Learning Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.