GIT is an open source Version Control System (VCS) that emphasizes on speed and efficiency. It is a very popular Version Control System used by many software development projects around the world.
What is Version Control System?
A version control system is a software used to keep track of changes made to one or more files over time.
Data as Snapshots
GIT store data as snapshots. A snapshot is a state of the files stored in the GIT repository at any point of time. Each change (commit) to the repository will create a new snapshot.
GIT is fast
Operations in GIT are very fast as compared to other VCS, since the operations are done in the local repository.
GIT is a distributed version control system, where the users need not always work on the remote repository. The users can copy a remote repository to the local machine. This is called cloning. Each cloned repository is a full copy of the remote repository and contains all information that the remote repository contains.
We generally create a clone of the remote GIT repository in our local system. All operations are done to this local repository. This is one of the major advantage of GIT over other VCS. This feature enables developers to work even when they are not connected to a network. All changes done to the local repository can later be pushed to the remote repository when network is available.
File States in a GIT project
Any file in GIT can be in three possible states: committed, modified or staged.
- Committed means the file is stored in the repository. These files reside in the GIT directory.
- Modified means the file is modified and the latest version is not stored in the repository. These files reside in the working directory.
- Staged means that the file was modified and is marked to be included in the next commit snapshot. These files reside in the staging area.
GIT Config is an important tool that can be used to set important configuration variables. These configuration variables are stored in a config file that resides in 3 possible places.
- <git installation directory>/etc/gitconfig. This file stores system wide variables which are applicable to all users in the system.
- C:/Users/<username>/.gitconfig. This file stores configuration variables specific to the user. This file overrides variable values in config file at point 1.
- In the repository (.git/config). It stores configuration variable specific to the repository. This file overrides variable values in config file at point 1 and 2.
Using git config to set configuration variables
Open GIT command prompt (GIT Bash) and use the command below. GIT bash can be opened by right clicking on the desktop as shown in the figure.
git config [file_option] <variable_name> <variable_value>
where, file_option is optional, possible values are:
--system: system wide config file.
--global: user specific config file
Example: git config --global user.name "Cube Article" git config --global user.email [email protected]
To read a configuration value we can use the following command.
git config [file_option] --list
To learm more we can use the below command which list all option available for "git config"
git config --help
The --help option can be used to get help about any commad in git.
The concept of condition beans enables Spring to restrict the creation of any bean depending on the evaluation of a condition. These beans get created only when a preset condition is evaluated as true