Git and Github Slides
Git and Github Slides
!2
What is Git?
• Git is a Version Control System (VCS) designed to make it
easier to have multiple versions of a code base,
sometimes across multiple developers or teams
!3
What is Git?
• Git is a Version Control System (VCS) designed to make it
easier to have multiple versions of a code base,
sometimes across multiple developers or teams
!4
What is Git?
• Git is a Version Control System (VCS) designed to make it
easier to have multiple versions of a code base,
sometimes across multiple developers or teams
• It is NOT GITHUB!
!5
Ok, then what is Github?
• Github.com is a website that hosts git repositories on a
remote server
!6
Ok, then what is Github?
• Github.com is a website that hosts git repositories on a
remote server
!7
Ok, then what is Github?
• Github.com is a website that hosts git repositories on a
remote server
!8
Confirm that you have git
• We can solve your issue when the lectures are over - sit
tight for now!
Configuring git
Your commits will have your name and email attached to them. To
confirm that this information is correct, run the following commands:
To fix either, just add the desired value in quotes after the command:
• If you do not see any SSH keys listed, you do not have
SSH configured with Github. We can assist with this later.
• From the command line, use git to create a new branch off of master to make
your edits to. To tie the branch to your issue on Github, make sure to include
the issue number after the branch name, e.g. branchName #1
• Stage edits to be committed to your git repository by using `git add <file
name>` to track the files that you want to add directly or `git add .` to
add all files at the current directory level that you have worked on.
• Push changes to save them by using `git push origin <branch name>`
Basic git / Github workflow
• On Github, create a new pull request for the branch that you have just
pushed, and add any clarifying comments that you deem necessary.
• In order to close the issue associated with the pull request, tell
GitHub to do so by adding ‘closes <issue number>’ in the comments.
(you can also use ‘closed, fix, fixes, resolve, resolves, and resolved’
before the issue number as well).
• Github will automatically check for merge conflicts. If there are any,
check to see what they are and resolve them.
• If merge conflicts arise, don’t fret! Many text editors (as well as
Github) provide tools to help track down conflicts and resolve
them. Often times, it will show incoming changes juxtaposed
with the current state of your file, and allow you to choose which
to keep (one or both).