Skip to main content
Contents
Dark Mode Prev Up Next Profile
\(\newcommand{\N}{\mathbb N} \newcommand{\Z}{\mathbb Z} \newcommand{\Q}{\mathbb Q} \newcommand{\R}{\mathbb R}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 5.8 Git Command Summary
It will take a while for this process and all of the commands to become a natural part of the way you work. Until that happens it is often useful to have a short concise cheat sheet of the command for accomplishing each task.
Exercises
1.
Match the tasks on the right with the appropriate git command listed on the left. The <...> notation indicates parameters that are needed to customize each use.
(a)
git switch <branch>
Change the active branch.
git pull upstream main
Synchronize the local main
branch with the upstream main
branch.
git push origin main
Synchronize the origin main
branch with the local main
branch.
Hint .
Note that the tasks listed are in approximately the same order as they appear in the sections of this chapter.
(b)
git merge <source>
Add changes from source branch into the active branch
git stage <file>
Indicate that changes to a file should be included in the next commit.
git commit -m "<message>"
Add staged changes to the active branch.
git push origin <branch>
Copy the named branch to your origin repository.
Hint .
Note that the tasks listed are in approximately the same order as they appear in the sections of this chapter.
You have attempted
of
activities on this page.