Who uses Git?
- Developers use git for code repo access
- Testers use git for storing
- Automation Scripts
- DevOps Engineers use git
- as first step to trigger the DevOps line
- To store the Scripts/IAC/CI CD Pipelines etc in Git.
- Configure and manage git (may be)
- Git Installation:
- First Option: Directly Download and install git from here
- Second Option: Install Chocolatey from here and relaunch powershell & execute
choco install git -y # to update to new version choco upgrade git
- If you install xcode or homebrew on machine git is automatically installed
- Git might be already installed. If not
# redhat based sudo yum install git -y # ubuntu based sudo apt-get install git -y
- Verify if the git is installed
- First time configuration
git config --global user.name "<your user name>" git config --global user.email "<your email>"
- Most version control systems use differences (delta’s) as shown in the below image
- Git thinks of data as a snapshot of the filesystem. Every time we make change and create a new version, Git takes a picture fo what all files look like at that moment. To be efficient, if the files are not changed, Git doesn’t store file again rather it links to previous identical files.
Terms of Git
- General: Where we can store data and we can maintain versions of the data stored, Helps you retrieve any version of data stored.
- So Git Repository should be where we store our code which has versions.
- If the Repository is present in your system, we call it local repository and if its on remote locations we call it remote repositories.
- Repositories are referred shortly as repos
Lets create a local repository and get a local repository
- Creating a local empty repository using git
- Get the local repository from some other remote repository
git clone <url of the remote repository>
- Git Stages: