Git Basics: Learn Do Real Work
Git Basics: Learn Do Real Work
i n t a = 1;
i n t b = 2;
i n t c = 3;
Create f i l e
i n t a = 1; int a = 1;
i n t b = 2; int b = 2;
i n t c = 3; int c = 3;
int d = 4;
Create f i l e Add a l i n e
i n t a = 1; int a = 1; i n t a = 1;
i n t b = 2; int b = 2; i n t c = 3;
i n t c = 3; int c = 3; i n t d = 4;
int d = 4;
i n t b = 2;
i n t c = 3;
i n t b = 2;
i n t c = 3;
i n t b = 2; i n t b = 2;
i n t c = 3; i n t c = 3;
i n t b = 2;
i n t c = 3;
i n t a = 1; i n t b = 2;
int b = 2; i n t c = 3;
i n t c = 3; i n t d = 4;
i n t a = 1; i n t b = 2;
i n t b = 2; i n t c = 3;
i n t c = 3; i n t d = 4;
int a = 21;
int b = 23;
int c= 34;
int d = 4;
int a = 1;
int b = 2;
int c = 3;
int d = 4;
i n t a = 1;
i n t b = 2;
i n t c = 3;
int a = 1;
int b = 2;
int c = 3;
int d = 4;
i n t a = 1;
i n t b = 2; int a = 1;
i n t c = 3; int b = 2;
int c = 3;
int d = 4;
int a = 1;
int b = 2;
int c = 3;
int d = 4;
i n t a = 1; int a = 1; i n t a = 1;
i n t b = 2; int b = 2; i n t c = 3;
i n t c = 3; int c = 3; i n t d = 4;
int d = 4;
i n t a = 1; int a = 1;
i n t b = 2; int b = 2;
i n t c = 3; int c = 3;
int d = 4;
Create f i l e Add a l i n e
int a = 21;
Int b = 32;
makes a copy of a repository stores it on int
int
c = 43;
d = 4;
your computer
a "fork" creates your own copy of someone
else's repository
in n tt aa==121 21;
;
Ii nntt bb==32;32;
makes a copy of a repository in
in
n tt cc= =
343;43;
n tt dd ==4 ;4 ;
g i t clone <url>
in n tt ba==21;21;
Ii nntt cb==23232;
;
makes a copy of a repository in
in
n tt c34;
c = 43;
n tt dd ==4 ;4 ;
int a = 1;
int b = 2;
int c = 3;
g i t clone <url> int d = 4;
in n tt aa==21;21;
II nnttb b== 32;32;
adds a file to "staging area" tells git to include the in
in
n tt c=
c 34
=3; 43;
n tt dd ==4 ;4 ;
int a = 1;
int b = 2;
int c = 3;
int d = 4;
in n tt ba =
= 21;21;
Ii nntt cbb =
= 32;
32;
adds a file to "staging area" tells git to include the in
in
n tt dc= 34;
= 43;
n tt dd ==4 ;4 ;
int a = 1;
int b = 2;
int c = 3;
int d = 4;
int e = 5;
in n tt aba== 12;21;
Ii nntt cbb =
= 23;32;
adds a file to "staging area" tells git to include the in
in
n tt cdc= 3
=43;43;
n tt dd ==4 ;4 ;
int a = 1;
int b = 2;
int c = 3;
g i t add f o o . c int d = 4;
int e = 5;
in n tt aba =
= 1221;
1;
Ii nntt bcbb== 2332;
2;
adds a file to "staging area" tells git to include the in
in
n tt cdc ==3443;
3;
n tt dd ==4 ;4 ;
int a = 1;
int b = 2;
int c = 3;
g i t add f o o . c int d = 4;
int e = 5; Changes t o be committed:
m o d if ie d: f o o . c
int a = 1;
int b = 2;
int c = 3;
int d = 4;
int e = 5;
int a = 1;
int b = 2;
int c = 3;
g i t commit -m int d = 4;
int e = 5;
"Add l i n e "
int a = 1; int a = 1;
int b = 2; int b = 2;
int c = 3; int c = 3;
g i t commit -m int d = 4; int d = 4;
int e = 5;
"Add l i n e "
Add l i n e
in n tt ba == 1221;
1;
Ii nntt bcb == 2332;
2;
-shows current status of repository in
in
n tt cdc ==34;43;
n tt dd ==4 ;4 ;
int a = 1; int a = 1;
int b = 2; int b = 2;
int c = 3; int c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
in n tt aba =
= 21;
21;
Ii nntt bcbb== 2332;
2;
- shows current status of repository in
in
n tt cdc ==43;43;
n tt dd ==4 ;4 ;
int a = 1; int a = 1;
int b = 2; int b = 2;
int c = 3; int c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
g i t st a t u s
in n tt aba =
= 21;21;
Ii nntt bcb =
= 23;32;
- shows current status of repository in
in
n tt dc= 3=43;43;
n tt dd ==4 ;4 ;
int a = 1; int a = 1;
int b = 2; int b = 2;
int c = 3; int c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
g i t st a t u s
On branch master
Your branch i s ahead o f ' o r i g i n / m a s t e r ' by 1 commit.
(use " g i t push" t o p u b lis h your l o c a l commits)
in n tt aba== 1221;
1;
- sends committed changes to Ii nntt bcbb== 2332;
in
2;
n tt cdc ==43;43;
int a = 1; int a = 1;
int b = 2; int b = 2;
int c = 3; int c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
i n tt aba == 1221;
1;
- sends committed changes to Ii nntt bcbb== 2332;
2;
in n tt cdc ==3443;
3;
remote repository i n tt dd ==4 ;4 ;
int a = 1; int a = 1;
g i t push int
int
b = 2;
c = 3;
int
int
b = 2;
c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
in n tt aba == 1221;
1; int a = 1;
Ii nntt bcbb== 2332;
2; int b = 2;
- sends committed changes to in
in
n tt cdcc == 34;
n tt dd= =
43;
4; 4;
int
int
c = 3;
d = 4;
int a = 1; int a = 1;
g i t push int
int
b = 2;
c = 3;
int
int
b = 2;
c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
Add l i n e Remove l i n e
int a = 1; int a = 1;
int b = 2; int b = 2;
int c = 3; int c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
Add l i n e Remove l i n e
int a = 1; int a = 1;
git pull int
int
b = 2;
c = 3;
int
int
b = 2;
c = 3;
int d = 4; int d = 4;
int e = 5;
Add l i n e
Add l i n e Remove l i n e
Add l i n e Remove l i n e
git pull
git pull
CONFLICT (content): Merge conflict in reverse.py
Automatic merge failed; fix conflicts and then
commit the result.
i n t a = 1;
<<<<<<< HEAD
i n t b = 2;
=======
i n t b = 0;
>>>>>>> 5468697320697320435335302e
git pull
i n t c = 3;
i n t d = 4;
i n t e = 5;
i n t a = 1;
your <<<<<<< HEAD conflicting commit
changes { i n t b = 2;
=======
remote
changes { i n t b = 0;
>>>>>>> 5468697320697320435335302e
git pull
i n t c = 3;
i n t d = 4;
i n t e = 5;
i n t a = 1;
<<<<<<< HEAD
i n t b = 2;
=======
i n t b = 0;
>>>>>>> 5468697320697320435335302e
git pull
i n t c = 3;
i n t d = 4;
i n t e = 5;
int a = 1;
int b = 2;
int c = 3;
int d = 4;
int e = 5;
git pull
g i t lo g
Changed a to 77
int a = 1; int a = 1;
g i t re se t --h a rd int
int
b = 2;
c = 3;
int
int
b = 2;
c = 3;
4761626 int d = 4; int d = 4;
int e = 5;
Add l i n e
Each branch has its own commit history and current version.
int a = 1;
int b = 2;
master int c = 3;
int d = 4;
int a = 1;
int b = 2;
master int c = 3;
int d = 4;
g i t branch t e s t s
int a = 1;
int b = 2;
master int c = 3;
int d = 4;
g i t branch t e s t s
int a = 1;
int b = 2;
tests int c = 3;
int d = 4;
int a = 1;
int b = 2;
master int c = 3;
int d = 4;
Thank You!
Copyright 2018. All rights reserved
learn = do real work