make the code work for you with #git
DESCRIPTION
Slides from my presentation on Java BootCamp #5 about Git. Java BootCamp #5 took place in Hradec Králové at 8. 11. 2012 http://www.java-bootcamp.cz/cs/bootcamp-5TRANSCRIPT
Make the code workfor you with #Git
Tomáš Jukin@Inza
Tomáš Jukin@Inza
#Objective-C#RubyOnRails
#Git
A long story short...
...about a SCM tool
...about a SCM toolSource Code Management
SCM?
Centralized
Distributed
SCM?
Centralized
DistributedGit,
Mercurial,...
CVS,SVN,
...
Why SCM?
FTP sucks
Mail sucks
Dropbox sucks
USB drive sucks
We NEED to share code!
...and...
Why SCM?
FTP sucks
Mail sucks
Dropbox sucks
USB drive sucks
We NEED to share code!
...and...
So?
Why SCM?
Which SCM?
Which SCM?
CVS is a history
SVN is centralized
Mercurial can’t rebase
...
Today, we NEED to:
...and...
be independantbe productivework offlinehave backupgrow
Which SCM?
CVS is a history
SVN is centralized
Mercurial can’t rebase
...
Today, we NEED to:
...and...
So?
be independantbe productivework offlinehave backupgrow
Distributed SCM
By geeks around Linux Kernel
The most powerful SCM out there
Tools Ecosystem
Submodules
GitHub
Rebase
Cherry-pick
Stash
http://git-scm.com/
http://book.git-scm.com/
http://progit.org/book/
Workflow
Me You
Workflow
Me You
Workflow
Me You
Workflow
Workflow
Working Copy
Workflow
Working Copy
Workflow
Working Copy
Local Repo
Workflow
Working Copy
Local Repo
Workflow
Working Copy
Index(stage)
Local Repo
Workflow
Working Copy
Index(stage)
Local Repo
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetch
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetch
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetchmerge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetchmerge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetch
pull or rebase
merge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetch
pull or rebase
merge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add commit push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
add
remove
commit push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
remove
push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
add commit
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
remove
push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
add commit
commit -a
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
remove
push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
addcommit
commit -aadd -A
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
remove
push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
addcommit
commit -aadd -A
?
Workflow
Working Copy
Index(stage)
Local Repo
Remote Repo
remove
push
fetch
pull or rebase
checkout HEAD
merge
RemoteLocal
addcommit
commit -aadd -A
?status
Creation (in code)
git clone [email protected]/foo.git foo_dir
cd foo_dir
Local Repo
mkdir foo_dir
cd foo_dir
git init
...or...
Creation (in code)
git clone [email protected]/foo.git foo_dir
cd foo_dir
Local Repo
mkdir foo_dir
cd foo_dir
git init
...or...
clone url
Creation (in code)Remote Repo
mkdir foo.git
cd foo.git
git init --bare
Workflow (in code)
git add -a
git commit -m “Updated foo class”
git push
Workflow (in code)
git add -a
git commit -m “Updated foo class”
git push
Workflow (in code)
git pull
git fetch
git merge bar_branch
...or...
Installation
Windows
msysgit - http://goo.gl/YdToL
MacOS
brew install git
Linux
apt-get install git
GUIWindows
TortoiseGit - http://goo.gl/9Gfhn
SmartGit - http://goo.gl/P8QqD
MacOS
GitX (L) - http://goo.gl/AMiqc
Linux
Choose yours - http://goo.gl/TebDq
Next?git flow
“Just one approach to solve branches, releases
and versions”
Next?Links
Interactive Git Cheatsheet - http://goo.gl/8yMZY
GitHub - http://github.com
semver - http://semver.org
git flow (about) - http://goo.gl/MAF6m
git flow (CLI tool) - http://goo.gl/IbOJr
@InzaTomáš Jukin
@JuicymoCZ