...Git by with a little help from my friends
gonna "collaborate on code projects" with a little help from friends...
Pull, Code, Commit, Push
collaborators:
Bob (command line) Crowley
Nate (SourceTree) Morse
Justin (GitKraken) LaRose
Pull, Code, Commit, Push
Git
overview
Pull, Code, Commit, Push
Being "great" at Git is a waste of your time, but if you aren't "good" at it, all your great code could go to waste.
Git
overview
Pull, Code, Commit, Push
Git enables Collaboration: this is one of its best features and we will show you how.
Historically Git was created to decentralize software version control, also to speed up and save disk resources. Making branching and merging fast and easy. Created by Linus Torvalds for Linux kernel development.
Git
overview
Pull, Code, Commit, Push
concept of
- Local and Origin repositories
- Keeping a history of all commits as a database of hashed compressed blobs
- Low cost of branching and merging your committed code
Git
started
Pull, Code, Commit, Push
Create a Git repository with your local code:
- make .gitignore file
- initilize the repo in the code folder
- create a new repository on GitHub
but don't initialize on github - link you local repo to the origin
then others can Clone your repo
FallingFrogs
Part of the "Wait, It's Fun!" family of spinner games.
https://nmorse.github.io/FallingFrogs/
Git
using the command line
Pull, Code, Commit, Push
Task #1 Give the Frogs more bounce
See: game.js lines 41, 42
Git
using SourceTree
Pull, Code, Commit, Push
Task #2 Fix Backwards Lilly-Pad motion and make move faster.
See: game.js lines 118 and 122
Git
using GitKraken
Pull, Code, Commit, Push
Task #3 Fix the overlapping frogs
make the frogs bounce off each other
See: game.js line 112
Git
going
Pull, Code, Commit, Push
- Pull: from origin (fetches and merges locally)
- Code: this is what you do
- Commit: first stage your files and then commit them to the current branch
- Push: sends your commits to the origin
Game Controller input #574
Accept input from game controller
Touchscreen input #2234
Accept input from a touchscreen
Pull, Code, Commit, Push
Fast track these two input device handlers (two developers working at the same time)
Merge
Automatic resolution
Code for the two new input devices (Game Controller and Touchscreen) are both implemented in the same area of a common file.
Lets see how these conflicts are resolved
Pull, Code, Commit, Push
Tilt frog on capture
See: game.js line 96
Tilt frog on capture
See: game.js line 96
Pull, Code, Commit, Push
Not a great moment in project management: two developers work on the same task and come up with different solutions.
Merge
with conflicts
Two developers have changed the same line of code
This requires manual resolution of conflicts.
Pull, Code, Commit, Push
Branch management
task switching with ease
We have shown Pulling and Pushing and Merging.
You can have any number of local branches to manage your commits to handle multiple tasks at the same time.
Pull, Code, Commit, Push
A bug needs
to be fixed in production
(a HotFix)
a quick fix is needed in production.
Pull, Code, Commit, Push
Longterm feature
Know the difference between merging one way and the other
Pull, Code, Commit, Push
Longterm feature
branches need a reality check every once in a while
Pull, Code, Commit, Push
Git
smart
Pull, Code, Commit, Push
Best practices
- Every branch is named for its a purpose
- Large tasks should have their own branch
- Pull often, so that you stay in sync with others
- Only push working and tested code to 'develop'
- Merge in from 'develop' into your feature branch often
Questions
We reserve the right to answer any and all questions with "We don't know."
Links
- github.com/crowcoder/FallingFrog
- git-scm.com
- www.sourcetreeapp.com
- www.gitkraken.com
Thank, You, Very, Much
deck
By Nate Morse
deck
- 1,401