Professional Documents
Culture Documents
Git & Github Basics: Gamecraft Training Radoslav Georgiev (@rado - G)
Git & Github Basics: Gamecraft Training Radoslav Georgiev (@rado - G)
GameCraft Training
Radoslav Georgiev (@Rado_G)
DISCLAIMER
I’m not a Git expert or pro
Agenda
• Why use Source Control System ?
• How to setup Git and Github on Windows ?
• Terminology
• Repositories 1.0 – git {init, add, commit, push, remote}
• Repositories 2.0 – .gitignore, git {clone, pull, revert, mv,
rm}
• Fork & Pull + Shared Repos
Why use Source Control Systems ?
What is ? Why use ?
• gg, wp
And some configuration ^_^
• Name & Email – Github tracks them
$ git config –global user.name “Firstname Lastname”
$ git config –global user.email “email@email.com”
• And commit it
$ git commit –m „This is a commit message‟
Some gitorish output
$ git status
• Outputs :
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: omgrofl.txt
• Almost there
$ git add omgrofl.txt
$ git status
How it works? Staging area.
What about Github ? Remotes ?
• Okay, you suck, there’s nothing @ Github
• Damn. Enter magic!
$ git remote add origin git@github.com:UserName/ProjectName.git
• Add an remote
$ git remote add origin git@github.com:UserName/ProjectName.git
• Celebrate !
DEMO
1) Create yourself a repo (from Github)
2) Add and Commit few files
3) Push them !
4) Repeat 2) and 3) few times
TAKE A BREAK.
We all deserve it
Agenda
• Why use Source Control System ?
• How to setup Git and Github on Windows ?
• Terminology
• Repositories 1.0 – git {init, add, commit, push, remote}
• Repositories 2.0 – .gitignore, git {clone, pull, revert,
mv, rm}
• Fork & Pull + Shared Repos
Don’t push your passwords
• Use .gitignore
$ touch .gitignore
$ echo “db_config.php” >> .gitignore
$ git add .gitignore
$ git push origin master
Enter passphrase!
• Something missing ?
$ git commit –m „You are not seeing my passwords!‟
Made a mistake ? No worries
• Unstage something – git reset