VCS – Why do I talk about this? – So why do I talk about this?



VCS – Why do I talk about this? – So why do I talk about this?

0 0


kpi-slides-vcs


On Github anxolerd / kpi-slides-vcs

VCS

Three letters that can change your life

Why do I talk about this?

Meet main characters

This is a story with a few characters. Let meet them!

Cthulhu The Cute

Twilight The Gentoo Pony

Shadow The Gamer

Once upon a time in R'lyeh Programming University...

Shadow played games the whole semester. At the end of the semester he had to do a lot of tasks but he did not know how.

So he asked Twilight for help

And then the terrible thing happened

Cute Cthulhu's wise words:

So why do I talk about this?

Because...

Sharing source code as attachments in social networks is like using stone instruments nowadays

Because...

Version control systems simplify software development

Especially when several people work on the same code together

Because...

It is vital to programmer to know how to use version control systems

Boring part

What is Version Control System?

“ Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.” “ Version control, also known as revision control or source control, is the management of changes to documents, computer programs, large web sites, and other collections of information.” — Wikipedia

Goals of VCS

  • Allow developers to work simultaneously.
  • Do not overwrite each other’s changes.
  • Maintain history of every version of everything.

VCS classification

  • Centralized version control systems (CVCS)
  • Distributed version control systems (DVCS)

Centralized VCS

There is a single “central” copy of your project somewhere, and programmers commit their changes to this central copy.

CVCS Workflow

Pull down any changes other people have made from the central server. Make your changes, and make sure they work properly. Commit your changes to the central server, so other programmers can see them.

Distributed VCS

Do not necessarily rely on a central server to store all the versions of a project’s files.

Every developer clones a copy of a repository and has the full history of the project on their own hard drive

Advantages over CVCS

  • Faster
  • Nobody sees unfinished work
  • Less dependent on Internet
  • Performing actions other than pushing and pulling changesets is extremely fast because the tool only needs to access the hard drive, not a remote server.
  • Committing new changesets can be done locally without anyone else seeing them. Once you have a group of changesets ready, you can push all of them at once.
  • Everything but pushing and pulling can be done without an internet connection. So you can work on a plane, and you won’t be forced to commit several bugfixes as one big changeset.

Version Control Systems

About 46 VCS exist now (https://goo.gl/imTGhs)

The most popular VCS

  • Subversion
  • Git
  • Mercurial

Interesting part

Hello, git!

Initialize an empty repository

git init

Add files

git add

Commit changes

git commit

What is your status?

git status

Local history

git log
 

Branches

git branch

Switch working tree

git checkout

Get it together

git merge

Put one onto another

git rebase

Working in team

Remotes

git remote add <name> <address>

Send commits to remote

git push <remote> <branch>

Update from remote

git fetch <remote>git pull <remote>

What to read next?

Git

Mercurial

Presentation by Oleksandr Kovalchuk

The end

Any questions?

VCS Three letters that can change your life