git init
Sage M. Abdullah
intro
outline
have you ever used...
have you ever used...
ctrl+z
version control system
version control system
Manages changes to collections of information.
version control system
Manages changes to collections of information.
version control system
Manages changes to collections of information.
version control system
medium.com/faun/centralized-vs-distributed-version-control-systems-a135091299f0
medium.com/faun/centralized-vs-distributed-version-control-systems-a135091299f0
git
git
git init
git init
.git
directorygit status
git status
let's add something!
let's add something!
git add
git add
git add file1 file2 ...
git commit
git commit
git commit -m "Your commit message here"
git commit
git config user.name "Your Name"
git config user.email "[email protected]"
--global
flag to make it the default.git commit
Why is that needed?
Git uses SHA1 hash to refer to commits. It's generated based on:
gist.github.com/masak/2415865
auth0.com/blog/hashing-passwords-one-way-road-to-security/
workflow in git
try repeating it!
git add file1 file2 ...
git add .
git commit -m "Update something"
git log
git log
how git stores commit
but it can be more complex than that...
how git stores commit
stackoverflow.com/a/24107223stackoverflow.com/a/9074343
how git stores commit
git branch
Things get more interesting with branches.
However, before that...
So far, we’ve only worked with git repositories locally.
if you're collaborating...
...how do you share your code?
if you're collaborating...
...how do you share your code?
let's push our repo!
let's push our repo!
git remote && git push
git remote && git push
git remote add origin https://git{hub,lab}.com/...
git push -u origin master
Remote name is usually origin
.
Default branch is master
.
voila!
git clone
git clone
git clone https://git{hub,lab}.com/...
git pull
git pull
git pull origin master
open source projects
open source projects
The source code of an open source software should be released under a license in which the copyright holder grants users the rights to study, change, and distribute the software to anyone and for any purpose.
open source projects
open source projects
contributing to open source
contributing to open source
contributing to open source
contributing to open source
contributing to open source
contributing to open source
contributing to open source
contributing to open source
{ "name": "Sage M. Abdullah", "slides": { "hosted": "https://slides.laymonage.com/git-init", "source": "https://github.com/laymonage/slides-git-init" "license": "https://creativecommons.org/licenses/by/4.0" } }