Skip to Content
Learning Git
book

Learning Git

by Anna Skoulikari
May 2023
Beginner
320 pages
8h 17m
English
O'Reilly Media, Inc.
Content preview from Learning Git

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Git

Head First Git

Raju Gandhi
Learning Go

Learning Go

Jon Bodner

Publisher Resources

ISBN: 9781098133900Errata PageSupplemental Content