Source Code Management / Version Control System
Source Code Management / Version Control System
§ Version control is a system that allows the software team to manage changes to the source code over time
-
§ This software tool makes it easier for developers to collaborate on different projects separating their tasks through
-
-
branches
§ It also gives the possibility to turn back to earlier versions for comparing and fixing the mistakes if needed
-
§ Version Control Systems (VCS) also known as SCM (Source Code Management) or RCS (Revision Control System) are
-
software tools for keeping track of changes to the source code over time
--File
A
*
- EY x72
-
version(
⑰
B
E
- abs
-
Ej versions
Y hellojs
hello.js i
↓ E version
par-E
los revert
Iversion 11
Benefits
§ Long-term change history
---
§ The changes made by developers, including the creating, modification, and deletion of files over the years, can be seen in history
§ It will allow going back to the previous version for analyzing bugs and fixing problems
§ Branching and merging
-
*
A
§ Branching helps work in an independent manner and not interfere with each other’s work
§ Merging brings the works together and allows seeing if there are conflicts between those works
§ Traceability
-
§ Ability to trace each change and connect it to project management and bug tracking software, as well as to annotate each change
with a message describing the purpose of the change
§ Synchronization
-
§ Files are saved at any time and restored from the last saved one
§ Undoing
-
§ You can undo both the last known version and the last one created a long time ago
§ Branching and Merging
-
§ Changes are made on a branch and after being approved, they can be merged with the master branch
Types
--
deprecated
Local Version Control System --
It
-
-
failure (S407)
single of
point
Centralized Version Control System
is
-
m
T
a
and Perforce -
X
↓
·
is
in in wormes
shared/remote
Distributed Version Control System repository
A
-
§ In Distributed Version Control Systems (DVCS), clients fully
mirror the repository, including its full history
§ If the server that these systems were collaborating with
dies, the client repositories can be copied back up to the
server to restore it
https://
§ Distributed Version Control Systems are Git, Mercurial,
Bazaar or Darcs
X
↓
§ Git was initially designed and developed by Linus Torvalds for Linux kernel development
-
§ Git is a free software distributed under the terms of the GNU General Public License version 2
--
History
-
§ The Linux kernel is an open source software project of very large scope
a
§ From 1991–2002, changes to the software were passed around as patches and archived files
-
§ In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper
-
-
§ In 2005, the relationship with BitKeeper broken down and tool’s free-of-charge status was revoked
---
§ tool’s free-of-charge status was revoked (and in particular Linus Torvalds) to develop their own tool based on some of the
lessons they learned while using BitKeeper
-
-
§ Simple design
-
§ Able to handle large projects like the Linux kernel efficiently (speed and data size)
-
-
Characteristics
§ Strong support for non-linear development -> branches
-
§ Distributed development
-
-
collaraboration
§ Toolkit-based design
-
I tools-> git, git-cat
§ Pluggable merge strategies *
*
-
Advantages
§ Free and open source
-
§ Implicit backup
-
§ Security
-
§ Easier branching
-
A
*A
Basic Workflow
-
> git init
thing
108
I
I it.
it
.
git
staging drea
Emlahesota-axent/tes-s
↑4:hello tet
Em
I-labeat/
lad
git init
->
§ The git init command is used to generate a new, empty Git repository or to reinitialize an existing one
-
§ With the help of this command, a .git subdirectory is created, which includes the metadata, like subdirectories for objects
- -
-
git config
§ The git config command is a function that sets configuration variables
§ It controls git look and operation
§ Levels
§ Local (--local)
§ When no configuration option is passed git config writes to a local level, by default
§ The repository of the .git directory has a file that stores local configuration values
§ Global (--global)
§ The application of the global level configuration includes the operating system user
§ Global configuration values can be found in a file placed in a user's home directory
§ System (--system)
§ The System-level configuration includes all users on an operating system and all repositories
§ System-level configuration file is located in a git config file of the system root path
git add
-
§ The git add is a command, which adds changes in the working directory to the staging area
-
§ With the help of this command, you tell Git that you want to add updates to a certain file in the next commit
-en
§ But in order to record changes, you need to run git commit too
-
§ In combination with the commands mentioned above, git status command is also needed to see which state the working
directory and the staging area are in
- -
-
git commit
-
§ The git commit command saves all currently staged changes of the project
§ Commits are created to capture the current state of a project
§ Committed snapshots are considered safe versions of a project because Git asks before changing them
§ Before running git commit command, git add command is used to promote changes to the project that will be then stored in
a commit
§ Working of commit
§ Git snapshots are committed to the local repository
§ Git creates an opportunity to gather the commits in the local repository, rather than making a change and commit it immediately to
the central repository
§ This has many advantages splitting up a feature into commits, grouping the related commits, and cleaning up local history before
committing it to the central repository
§ This also gives the developers an opportunity to work in an isolated manner
git log
-
- -
!
main
- -
A code
seasintere
② task - B contains
-
well tested code
③ tasks
D
- C
main branch l
-
- -
-
commit I -commit I
-
Commit 2 - Commit 2
-commit3 Commit 3
branch -
branch commits *A
of
-
Branching
-
§ Branching allows developers to branch out from the original code base and work separately
-