Difference between revisions of "Version Control"

From eLinux.org
Jump to: navigation, search
(Why use it: minor)
m (Encouraging people to adapt the material)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Justification=
+
This material is published at http://alecthegeek.github.com/version-control-basics/
  
# VC is an important skill for developers and a prerequisite for developing quality software
 
# DVCS will provide a useful platform for students to work together on projects
 
  
=Outcomes=
+
It is developed at https://github.com/alecthegeek/version-control-basics. Please fork and send a pull request. The material is distributed under a free content. Please adapt the material for your own needs.
 
 
# Able to describe the benefits of using version control
 
# Can use Git for version control of new and existing projects, including working in a group
 
## Create a local repo
 
## Commit a change
 
## Create a branch
 
## Show the history
 
## SHow change differences
 
## Perform a local merge
 
## Push and pull changes to a remote repo
 
 
 
=Introduction=
 
==What is it==
 
Version Control (VC) is a common practice used to track all the changes that occur to the files in a project over time. It needs a Version Control System (VCS) tool to work
 
 
 
==Why use it==
 
There are three types questions a VCS helps answer
 
#What changes were made in the past, why were they made and who made them (via commit history and commit comments)
 
#How can undo a change I've made in error and "roll back" to start again
 
# How can I share my changes with the rest of the project team
 
 
 
==Tools available==
 
* Distributed vs. Centralised
 
*:Modern VCS work on a distributed model (DVCS). This means that every member of the project team keeps a complete local copy of all the changes. The previous model, still widely used with tools like Subversion, is centralised. There is only one central database with all the changes and team members only have a copy of the change they are currently working on.
 
* Open Source and Commercial Tools
 
* What the tools do
 
** Commit history
 
** Diff listing
 
** Integrate with other tools (e.g. Ticket Systems, built Systems, project management etc)
 
 
 
=An example using Git=
 
 
 
Git is vey popular DVCS originally developed to maintain the GNU/Linux kernel source code (the operating system that usually runs on the Raspberry Pi). It is now used by many very large open
 
source projects and a lot of commercial development teams. Git is very flexible and has a reputation of being hard to use, but we are only going to concentrate on the ten or so commands you need to
 
be useful day to day.
 
 
 
These examples assume that you are using Debian Linux on a Raspberry Pi and have downloaded the Python Snakes project from #TODO into a directory called <code>snakes</code>. All the commands are issued from
 
a terminal. You can start the terminal from the LXDE GUI by #TODO..... Initially this example assumes that the current directory is your home directory, which is the default when you start a terminal window.
 
 
 
* Setup up
 
# Make sure you have the correct tools installed by tying the following commands:
 
  sudo apt-get install git git-gui git-gitk
 
# Test the installation with the command
 
  git --version
 
#: you should see something like
 
  git version 1.7.10
 
Tell Git who you are (this is very important information and it recorded in every change in you make or commit)
 
  git config --global user.name "My Name"
 
  git config --global user.email "myname@mycollege.ed.uk"
 
 
 
You should of course substitude your own name and email address in the correct places. Git records that information is a use configuration file called .gitconfig in your home directory
 
* Creating a repo
 
* Committing a file
 
* Making a change
 
* Showing the diff
 
* Committing the change
 
* Showing the history
 
* Branches
 
 
 
= Working with other=
 
 
 
* Remote repos
 
* Merging
 
* Patches
 

Latest revision as of 15:52, 27 May 2012

This material is published at http://alecthegeek.github.com/version-control-basics/


It is developed at https://github.com/alecthegeek/version-control-basics. Please fork and send a pull request. The material is distributed under a free content. Please adapt the material for your own needs.