3. CENTRALIZEDVERSION CONTROL
SYSTEM
• One endpoint (one server), all your changes goes to server,
immediately on commit
• Difficult branching (you possibly need to duplicate project directory)
• difficult conflict resolving
4. • Pull down any changes from another teammates
• Make your changes
• Commit your changes to the server and resolve conflicts
TYPICAL WORKFLOW
5. DECENTRALIZEDVCS
• One, two, three, …, N servers or Zero (What? 0_o)
• duplication
• faster works (one server in office, one in DC, pushing to office, then office
pushed to DC’s)
• Easy branching
• branch isn’t just a directory copy, it’s a real branch -> easy conflict resolving
11. MAKING DIFFS
Make diff with
git diff -u HEAD
m
aster
Initial commit
staging
DIFF !== PATCH
12. MAKING DIFFS
Make diff with
git diff -u HEAD
m
aster
Initial commit
staging
DIFF !== PATCH
Why? Later… Be patience ;)
13. MAKING BRANCH
Making branches is so simple as
git checkout -b “develop”
, where develop is a new branch name.
Commit your changes.
m
aster
Initial commit
Add main.c
develop
15. MAKING PATCH
Why we need patch?
Making patch to master branch from current:
git format-patch mater —stdout > ../1.patch
m
aster
Initial commit
Add main.c
develop
What is difference between
diff and patch?
16. WORKING WITH PATCH
Before applying check patch for
errors.
m
aster
Initial commit
Add main.c
develop
17. APPLYING PATCH
Switching back to master by
git checkout master
And apply the patch with
git am —signoff < ../1.patch
m
aster
Initial commit
Add main.c
develop
Add main.c
19. ADDING REMOTES
If you need to add a remote for your
local git repo, just use
git remote add origin git@host:repo.git
m
aster
Initial commit
Add main.c
develop
Add main.c
Also you can add different remotes for
different branches or pulling from one and
push to second.
20. PUSH
The common use of push is to run it from current
local branch and set remote and remote branch
where to push:
git push -u origin [master | —all]
m
aster
Initial commit
Add main.c
develop
Add main.c
21. CLONE
Let’s create a new repo from cloning our first and
make some changes in it and push them back.
git clone /tmp/repo.git dolly
m
aster
Initial commit
Add main.c
develop
Add main.c
Readme change
22. PULL
Ok. Let’s go to our first working copy
and execute
git pull
m
aster
Initial commit
Add main.c
develop
Add main.c
Readme change