intro to git, github, and devpost
TRANSCRIPT
Code Collaboration and Submission
Git, GitHub, and Devpost 1
Git, GitHub, and Devpost
Git, GitHub, and Devpost 2
whoami
Git, GitHub, and Devpost 3
whoami
• Fifth year Software Engineering @ UF
Git, GitHub, and Devpost 4
whoami
• Fifth year Software Engineering @ UF
• Officer of the UF Student InfoSec Team
Git, GitHub, and Devpost 5
whoami
• Fifth year Software Engineering @ UF
• Officer of the UF Student InfoSec Team
• Full stack web developer
Git, GitHub, and Devpost 6
whoami
• Fifth year Software Engineering @ UF
• Officer of the UF Student InfoSec Team
• Full stack web developer
• Currently web eng lead at Quottly
Git, GitHub, and Devpost 7
whoami
• Fifth year Software Engineering @ UF
• Officer of the UF Student InfoSec Team
• Full stack web developer
• Currently web eng lead at Quottly
• Former security intern at Tumblr
Git, GitHub, and Devpost 8
whoami
• Fifth year Software Engineering @ UF
• Officer of the UF Student InfoSec Team
• Full stack web developer
• Currently web eng lead at Quottly
• Former security intern at Tumblr
• Former intern at BlockScore
Git, GitHub, and Devpost 9
whoami
• Fifth year Software Engineering @ UF
• Officer of the UF Student InfoSec Team
• Full stack web developer
• Currently web eng lead at Quottly
• Former security intern at Tumblr
• Former intern at BlockScore
• Reach me @andrew on Slack
Git, GitHub, and Devpost 10
Git
Git, GitHub, and Devpost 11
At it's core, git is version control
Git, GitHub, and Devpost 12
What is version control?
Git, GitHub, and Devpost 13
Version control tracks changes in your code
Git, GitHub, and Devpost 14
Git, GitHub, and Devpost 15
Why is this useful?
Git, GitHub, and Devpost 16
Collaboration
Git, GitHub, and Devpost 17
How does this work?
Git, GitHub, and Devpost 18
How does this work?
1. Download code from remote server
Git, GitHub, and Devpost 19
How does this work?
1. Download code from remote server
2. Make your changes
Git, GitHub, and Devpost 20
How does this work?
1. Download code from remote server
2. Make your changes
3. Upload code to remote server
Git, GitHub, and Devpost 21
How does this work?
1. Download code from remote server
2. Make your changes
3. Upload code to remote server
4. Version control figures out what has changed and applies those changes to the codebase
Git, GitHub, and Devpost 22
Cool, so let's talk about git
Git, GitHub, and Devpost 23
Git Basics
Git, GitHub, and Devpost 24
Open up a terminal!
Git, GitHub, and Devpost 25
1. Make a new directory
Git, GitHub, and Devpost 26
2. git init
Git, GitHub, and Devpost 27
3. git status
Git, GitHub, and Devpost 28
4. Make a file
Git, GitHub, and Devpost 29
5. git status
Git, GitHub, and Devpost 30
6. git add .
Git, GitHub, and Devpost 31
6. git add .
• "staged files" are files that are ready to be committed to git
• "unstaged files" are files that have changes that have not been prepared to be committed
Git, GitHub, and Devpost 32
can also use git add [filename] for individual files
Git, GitHub, and Devpost 33
7. git status
Git, GitHub, and Devpost 34
8. git commit -m 'Summary of changes'
Git, GitHub, and Devpost 35
9. git log
Git, GitHub, and Devpost 36
Any questions?
Git, GitHub, and Devpost 37
Git Branches
Git, GitHub, and Devpost 38
Git Branches
• A "copy" of code that developers can work on independently of the main code base
Git, GitHub, and Devpost 39
Git Branches
• A "copy" of code that developers can work on independently of the main code base
• The main code base is normally "master"
• Once the developer is done, can "merge" it back into master
Git, GitHub, and Devpost 40
git branch [branchname]
Git, GitHub, and Devpost 41
Once we have a new branch, we follow the git flow
Git, GitHub, and Devpost 42
We have new code on a branch, how do we merge back?
Git, GitHub, and Devpost 43
git checkout master
Git, GitHub, and Devpost 44
git merge [branchname]
Git, GitHub, and Devpost 45
Using branches allows for multiple developers to work on
the same code base
Git, GitHub, and Devpost 46
Any questions?
Git, GitHub, and Devpost 47
Git Remotes
Git, GitHub, and Devpost 48
Git Remotes
• A remote server for your git repository!
Git, GitHub, and Devpost 49
Git Remotes
• A remote server for your git repository!
• This is where GitHub comes in...
Git, GitHub, and Devpost 50
GitHub
Git, GitHub, and Devpost 51
Powerful collaboration, code review, and code
management foropen source and private
projects.Git, GitHub, and Devpost 52
Helps put a GUI on top of git!
Git, GitHub, and Devpost 53
Sign up for GitHub at github.com
Git, GitHub, and Devpost 54
Once signed up, create a repository
Git, GitHub, and Devpost 55
Get the remote ssh url
Git, GitHub, and Devpost 56
Back to the command line...
Git, GitHub, and Devpost 57
git remote add origin [url]
Git, GitHub, and Devpost 58
git remote -v
Git, GitHub, and Devpost 59
So, how do we get code on our remote?
Git, GitHub, and Devpost 60
git push
Git, GitHub, and Devpost 61
Awesome! Now we've got code on GitHub
Git, GitHub, and Devpost 62
Once a teammate pushes changes, make sure to use git pull to download the new
changes
Git, GitHub, and Devpost 63
Any questions?
Git, GitHub, and Devpost 64
GitHub + Devpost
Git, GitHub, and Devpost 65
Git, GitHub, and Devpost 66
Preparing your GitHub repo for submission
Git, GitHub, and Devpost 67
1. Create a README.md file
Git, GitHub, and Devpost 68
Example: https://github.com/andrewjkerr/hackathon-mentor-
request-slackbot
Git, GitHub, and Devpost 69
Git, GitHub, and Devpost 70
2. Set the description
Git, GitHub, and Devpost 71
"A slackbot to help manage mentorship
requests for hackathons (aka SwampHacks)."
Git, GitHub, and Devpost 72
Anddd that's it! Pretty easy, eh?
Git, GitHub, and Devpost 73
To review
Git, GitHub, and Devpost 74
To review
1. git pull
Git, GitHub, and Devpost 75
To review
1. git pull2. git checkout -b branch
Git, GitHub, and Devpost 76
To review
1. git pull2. git checkout -b branch3. Make changes
Git, GitHub, and Devpost 77
To review
1. git pull2. git checkout -b branch3. Make changes4. git add .
Git, GitHub, and Devpost 78
To review
1. git pull2. git checkout -b branch3. Make changes4. git add .5. git commit -m 'commit summary'
Git, GitHub, and Devpost 79
To review
1. git pull2. git checkout -b branch3. Make changes4. git add .5. git commit -m 'commit summary'6. git checkout master
Git, GitHub, and Devpost 80
To review (continued...)
1. git pull
Git, GitHub, and Devpost 81
To review (continued...)
1. git pull2. git merge branch
Git, GitHub, and Devpost 82
To review (continued...)
1. git pull2. git merge branch3. git push
Git, GitHub, and Devpost 83
To review (continued...)
1. git pull
2. git merge branch
3. git push
4. Do it all again!
Git, GitHub, and Devpost 84
Git and GitHub can help teams work more efficiently on code
Git, GitHub, and Devpost 85
(And it doesn't hurt that GitHub works well with Devpost)
Git, GitHub, and Devpost 86
Any questions?
Git, GitHub, and Devpost 87
Slides available at talk.andrewjkerr.com
Git, GitHub, and Devpost 88