140. Hash Benefits
Independence
ā£ Time & location separation from sequence # of
checkin.
ā£ Easy merging of repositories
ā£ Easy identiļ¬cation of what needs to be synced
145. Subversion
ā£ svn commit
ā£ Adds everything modiļ¬ed.
ā£ ācommittedā locally and on the server.
ā£ Must list if you want speciļ¬c ļ¬les.
ā£ What if you check in your password?
150. Git
ā£ git add
ā£ git commit
ā£ git push
ā£ Commits only what is added to the index.
ā£ Opportunity to change history locally.
ā£ Selectively share with other repos.
153. repo
git clone git://somedomain/myproj.git B uild
cd myproj.git
dex
pda te in
git checkout master U
echo ā//Commentsā >> ClassOne.java or king
echo ā//Thoughtsā >> ClassTwo.java E dit w
154. repo
git clone git://somedomain/myproj.git B uild
cd myproj.git
dex
pda te in
git checkout master U
echo ā//Commentsā >> ClassOne.java or king
echo ā//Thoughtsā >> ClassTwo.java E dit w
to i ndex
git add ClassOne.java Add epo
ave to r
git commit -māAdded commentsā S
155. repo
git clone git://somedomain/myproj.git B uild
cd myproj.git
dex
pda te in
git checkout master U
echo ā//Commentsā >> ClassOne.java or king
echo ā//Thoughtsā >> ClassTwo.java E dit w
to i ndex
git add ClassOne.java Add epo
ave to r
git commit -māAdded commentsā S
st ash
git stash Pus h to
156. Remote
is like a special
Stash
Repo
Index
Working
157. Remote
is like a special
Stash
Repo
Index
Working
158. Remote
is like a special
Stash
Repo
git clone
Index
Working
159. Remote
is like a special
Stash
Repo
git clone
git checkout
Index
Working
160. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
Index
Working
161. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
Index
Working
162. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
test buggy ļ¬les
Index
Working
163. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
test buggy ļ¬les
Index git stash apply
Working
164. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
test buggy ļ¬les
Index git stash apply
Working git add
165. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
test buggy ļ¬les
Index git stash apply
Working git add
git commit
166. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
test buggy ļ¬les
Index git stash apply
Working git add
git commit
git push
167. Remote
is like a special
Stash
Repo
git clone
git checkout
edit experiment ļ¬les
git stash
test buggy ļ¬les
Index git stash apply
Working git add
git commit
git push
170. $ echo //MYD0GSNAM3 >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt
$ git status
# On branch master
# Changed but not updated:
# modified: mattfile1.txt
# modified: mattfile2.txt
171. $ echo //MYD0GSNAM3 >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt
$ git status
# On branch master
# Changed but not updated:
# modified: mattfile1.txt
# modified: mattfile2.txt
o in dex
int
$ git add mattfile1.txt Put
172. $ echo //MYD0GSNAM3 >> mattfile1.txt
$ echo //NewText2 >> mattfile2.txt
$ git status
# On branch master
# Changed but not updated:
# modified: mattfile1.txt
# modified: mattfile2.txt
o in dex
int
$ git add mattfile1.txt Put
to r epo
S ave
$ git commit -m'Matts pw checkin'
[master]: created ddcdf18: quot;Matts pw checkinquot;
1 files changed, 1 insertions(+), 0 deletions(-)
174. Change History
$ git reset --hard HEAD^
HEAD is now at 9de4cd3 First checkin
$ git log
commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993
Author: Matthew McCullough
<matthewm@ambientideas.com>
Date: Wed Mar 4 23:09:17 2009 -0700
First checkin
175. Change History
com mit
the
w a way
$ git reset --hard HEAD^ T hro
HEAD is now at 9de4cd3 First checkin
$ git log
commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993
Author: Matthew McCullough
<matthewm@ambientideas.com>
Date: Wed Mar 4 23:09:17 2009 -0700
First checkin
176. Change History
com mit
the
w a way
$ git reset --hard HEAD^ T hro
HEAD is now at 9de4cd3 First checkin
$ git log
commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993
Author: Matthew McCullough
<matthewm@ambientideas.com>
Date: Wed Mar 4 23:09:17 2009 -0700
First checkin
184. aem on
git clone git://somehost.org/myproj.git g it d
git clone mccm06@somehost.org:myproj.git SSH
185. aem on
git clone git://somehost.org/myproj.git g it d
git clone mccm06@somehost.org:myproj.git SSH
git clone http://somehost.org/myproj.git H TTP
186. aem on
git clone git://somehost.org/myproj.git g it d
git clone mccm06@somehost.org:myproj.git SSH
git clone http://somehost.org/myproj.git H TTP
sys tem
git clone ~/work/myproj.git File
187. aem on
git clone git://somehost.org/myproj.git g it d
git clone mccm06@somehost.org:myproj.git SSH
git clone http://somehost.org/myproj.git H TTP
sys tem
git clone ~/work/myproj.git File
rk d rive
Ne two
git clone z:someservermyproj.git
194. Rebase for Clarity
git checkout myfeaturebranch
git rebase master
ā£Cleaner history than a merge.
ā£Fast forwards original branch.
ā£Lets you see āhow trunk will actā before you merge.
ā£Reposition your feature branchās start point.
ā£Makes for simpler merge graphs.
195. M
da
S er
r
ta g
d
n e
Master/Trunk/MainLatest
196. M
da
S er
r
ta g
d
n e
Master/Trunk/MainLatest
a32
197. ard Bra
d
n e
ta g
a32 n ch
S er
Master/Trunk/MainLatest
M 2e2
198. ard Bra
d
n e
ta g
a32 n ch
S er
Master/Trunk/MainLatest
d19
M 2e2
199. ard Bra
d
n e
ta g
a32 n ch
S er
Master/Trunk/MainLatest
d19
M 2e2
8b3
200. ard Bra
d
n e
ta g
a32 n ch
S er
Master/Trunk/MainLatest
d19
M 2e2
e69
8b3
201. ard Bra
d
n e
ta g
a32 n ch
S er
Master/Trunk/MainLatest
d19
M 2e2
e69
8b3
erge
M
9f1
277. Squash Verbosity
ā·
ā£git merge --squash mybranch
ā£Reduce all your micro-checkins to block commits.
278. Squash Verbosity
ā·
ā£git merge --squash mybranch
ā£Reduce all your micro-checkins to block commits.
ā£Make mistakes, revise, checkin without hesitation.
279. Squash Verbosity
ā·
ā£git merge --squash mybranch
ā£Reduce all your micro-checkins to block commits.
ā£Make mistakes, revise, checkin without hesitation.
ā£Great for SVN compatibility.
288. Twitter
@matthewmccull Matthew
Blog
http://www.ambientideas.com/blog
sidebar has all my social media links
Email
matthewm@ambientideas.com
GitHub
http://github.com/matthewmccullough