Oen, a new branch is used in the workspace to make a series of changes. Aer these
changes have been commied, reviewed, and pushed to the repository they need to
be merged into the master branch. provide an interface for reviewing
and merging changes from one branch to another.
On the
GitHub repository page, select
the branch you want to
merge and “
” located above
the le list. Alternavely, if
the branch is new GitHub
will show an orange box
with a “Compare & pull
request” buon. GitHub will
provide a simple form to
create the pull request with a tle and descripon. Above the form is a blue box which
you can use to specify which branch to merge into. It should default to master, which
is what we want. Below the form is a list of commits and a “di,” or comparison of
changes between the two branches. Once you know that the changes are correct,
“” .
Aer creang the pull request, you will be brought to the web page for
that request. Normally this would provide an opportunity for other contributors
to inspect your changes and provide feedback. When the pull request has been
reviewed, merge it by “” “
” . A message can be provided if desired.
Aer merging a pull request, the
branch may not be needed any more.
The pull request page will oer a
buon to delete the branch on the
repository. To delete the branch on your workspace, use the command git branch
–D <branch> where <branch> is the name of the branch you wish to delete.
. The master branch on the repository change should now look
the same as the branch which was merged.
When working as a team on a project with many documents, it can be very frustrang
trying to keep things organized. When passing les around, it can be a struggle to
know which version is the most recent. Two team members may want to do work on
the same le at the same me for enrely dierent reasons. If they each work on their
copy of the le, which do you keep
at the end? How do you combine
their changes?
A le server or shared folder can
help keep all of the les in one place, but eding with mulple people is sll
troublesome. For some les, a collaborave editor such as Google Docs may help
migate the issue, but simultaneous eding can be confusing and there are few editors
which are truly designed for it. What we really need is a tool to allow mulple people
to work on the same le
and easily combine their
changes.
Git is a
soware soluon. It is
designed to allow mulple contributors to edit a pool of les located in a .
GitHub is a website which hosts Git repositories. Although other version control
soluons and repository hosng sites exist, Git and GitHub are parcularly popular and
powerful.
Can combine mulple sets of changes to a single text le
Shows which contributor is responsible for each change
Allows changes to be removed or reverted
Makes it easy to nalize and distribute specic versions
This booklet is designed to teach fundamental version control concepts and explain
how to use these concepts with Git and GitHub. Both tools oer a plethora of
addional features, but aer nishing these instrucons you will be able to set them
both up and properly use their primary features on a Windows computer. Since Git is
most oen used via a command line interface, basic instrucons on how to use the Git
Bash soware will also be provided.
Before beginning these instrucons, it is assumed that you are familiar with some
basic funconality of a modern Windows computer. This includes the ability to start
programs, navigate the le system using the Windows Explorer soware, and navigate
to and interact with web pages. If any of these tasks sound unfamiliar, it is
recommended that you learn them before connuing with this booklet.
1
14
Although Git is most oen used for programming
projects, it works well with any projects which use
plain-text les. This includes web development,
LaTeX, markup, or simple text documents.
1
2