V e r s i o n C o n t r o l w i t h G i t ● B e f o r e w e s t a r t ● S i g n u p a t g i t h u b . c o m ● P a r t n e r u p w i t h t h e p e r s o n n e x t t o y o u 1
W h a t i s V e r s i o n C o n t r o l ? ( A K A r e v i s i o n c o n t r o l , s o u r c e c o n t r o l ) ● T r a c k s c h a n g e s t o f i l e s ● A n y f i l e c a n b e t r a c k e d ● T e x t ( . t x t , . c s v , . p y , . c , . r e t c . ) w o r k s b e s t ● T h e s e a l l o w s m a r t d i f / m e r g e e t c . 2
W h y U s e V e r s i o n C o n t r o l ? # 1 ● A m o r e e fg i c i e n t b a c k u p ● R e p r o d u c i b i l i t y 3
W h y U s e V e r s i o n C o n t r o l ? # 2 ● T e a m w o r k 4
V e r s i o n C o n t r o l T r a c k s C h a n g e s ● C h a n g e s a r e t r a c k e d s e q u e n t i a l l y 5
V e r s i o n C o n t r o l T r a c k s C h a n g e s ● D i fg e r e n t v e r s i o n s c a n b e s a v e d 6
V e r s i o n C o n t r o l T r a c k s C h a n g e s ● M u l t i p l e v e r s i o n s c a n b e m e r g e d 7
V e r s i o n C o n t r o l A l t e r n a t i v e s ● S u b v e r s i o n ( s v n ) - C e n t r a l i s e d ● M e r c u r i a l ( h g ) - D i s t r i b u t e d ● G i t ( g i t ) – D i s t r i b u t e d ● N . B . G i t H u b ! = g i t 8
L o c a l C o n f i g u r a t i o n ● g i t c o n f i g 11
C r e a t i n g a R e p o s i t o r y ● g i t i n i t ● g i t s t a t u s 12
T r a c k i n g C h a n g e s t o F i l e s ● g i t a d d ● g i t c o m m i t 13
G i t – a d d a n d c o mmi t Staging Workspace Local Repo Area add commit Visible File System Git Repository 17
E x p l o r i n g H i s t o r y # 1 ● g i t l o g ● g i t d i fg 15
G i t – d i fg # 1 Staging Workspace Local Repo Area diff diff --staged Visible File System Git Repository 17
G i t – d i fg # 2 Staging Workspace Local Repo Area diff sl33v51a sl33v51a f22b25e g31a45d HEAD ~2 HEAD ~1 diff HEAD HEAD Visible File System Git Repository 17
R e s t o r i n g F i l e s ● g i t c h e c k o u t 15
G i t - r e s t o r a t i o n Staging Workspace Local Repo Area f22b25e sl33v51a checkout f22b25e f22b25e g31a45d HEAD ~2 HEAD ~1 g31a45d checkout HEAD HEAD Visible File System Git Repository 17
G i t W o r k f l o w – L o c a l R e p o . 17
C o l l a b o r a t i o n Sarah's computer Fred's computer /home/sarah/planets /home/fred/planets A B 17
C o l l a b o r a t i o n ● L e t ' s c o l l a b o r a t e v i a r e m o t e r e p o ● W o r k i n g i n p a i r s : ● D e v e l o p e r A / D e v e l o p e r B 18
C o l l a b o r a t i o n : R e mo t e R e p o s i t o r i e s # 1 ● D e v e l o p e r A – S i g n i n h t t p s : / / g i t h u b . c o m / – C r e a t e r e p o s i t o r y – g i t r e m o t e a d d – g i t p u s h – A d d D e v e l o p e r B a s a c o l l a b o r a t o r
C o l l a b o r a t i o n : R e mo t e R e p o s i t o r i e s # 2 ● D e v e l o p e r B – C l e a n u p – g i t c l o n e – g i t a d d – g i t c o m m i t – g i t p u s h
C o l l a b o r a t i o n : R e mo t e R e p o s i t o r i e s # 3 ● D e v e l o p e r A – g i t p u l l
C o l l a b o r a t i o n : R e mo t e R e p o s i t o r i e s # 4 ● E x e r c i s e – D e v e l o p e r A – A d d R E A D M E . m d , ( a u t h o r s a n d i n f o ) . – D e v e l o p e r B – s y n c u p y o u r r e p o s i t o r y
C o l l a b o r a t i o n : C o n f l i c t s # 1 mm = inches * 25.4 return mm mm = inches * 25.4 return mm # TODO(Sarah): Add fu
C o l l a b o r a t i o n : C o n f l i c t s # 2 mm = inches * 25.4 return mm mm = inches * 25.4 mm = inches * 25.4 return mm return mm # TODO(Sarah): Add fu # TODO(Fred): Add fu ?
G i t W o r k f l o w – R e mo t e R e p o . 21
W h a t n e x t ? ● B r a n c h i n g / M e r g i n g ● h t t p s : / / s o fu w a r e - c a r p e n t r y . o r g 22
Recommend
More recommend