4. Definition
Version controlVersion control is a system that records
changes to a file or set of files over time so that
you can recall specific versions later.
“git documentation”
8. Install Git
● Mac
download from
http://sourceforge.net/projects/git-osx-installer/
● Windows
download the installer exe file from
http://msysgit.github.com/
9. Let's start
● Some definitions before dealing with Git
commands
– Branch
is the duplication of an object under version control (such
as a source code file, or a directory tree) so that
modifications can happen in parallel along both branches.
in other word, branch contains a series of snapshots of
file or set of files of the project
by default, you have the default branch in your project
called: Master
10. – Merge
is a fundamental operation that reconciles multiple
changes made to a version-controlled collection of files
– Commit
is the making of a set of tentative changes permanent. A
popular usage is at the end of a transaction. A commit is
an act of committing.
11. – Repository
is a concept from version control that refers to a data
structure, usually stored on a server, that contains,
among other things:
A set of files and directories.
Historical record of changes in the repository.
A set of commit objects.
12. – Decentralized version control (DVCS)
keeps track of software versions and allows many developers to work on a given
project without requiring that they maintain a connection to a common network
such as: Github, Bitbucket
13. Git commands
● git init .
Create an empty Git repository or reinitialize an
existing one
● git remote add origin (repository url)
to add remote repository
● git add .gitignore
to add files which you want git to ignore it and don't
push it to server
14. ● git fetch
to update branches
● git checkout (branch name)
to switch from branch to another
● git checkout -b (branch name)
create a new branch and switch to it
15. ● git add .
This command updates the index using the current
content found in the working tree
● git pull origin (branch name)
Merging upstream changes into your local repository
● git push origin (branch name)
Push the specified branch to <remote>, along with all of
the necessary commits and internal objects
16. ● git commit -m “commit description”
to commit last changes on your work tree.
● git status
displays the state of the working directory and the
staging area