Site icon Synapse QA

Git Study Notes

Git Study Notes

Overview:

Chapter 1:

What is Version Control?

By Using the Version Control System you can handle different versions of the same source code file in your test automation project.

Version Control System (Use):

 It is used to keep track of the changes made over time to source code, documentation & configuration files.

Advantages: –

Team collaboration, Integration of your test automation code into a CI/CD Pipeline, fast feedback loop through checking out feature branches for early testing, learning source control concepts can boost your learning journey to other technical skills.

Chapter 2:

An Introduction to Git

Git: –

 SHA-1 (Use):

 To uniquely identity the stored object in the git database.

 Modified, Staged, and Committed: –

 These three different states are called git where a file can reside in.

Chapter 3.1

Basic Git Concepts

  1. git –help: give you a full detailed description of that particular command.

         git help<commands>

  1. 2. git -scm.com
  1. 3. git -config: first set your username and your user email address. Git will then associate every single commit with these two things.

–system/global/local

–system, –global or — local: Git for which scope on your machine you want to set a specific configuration.

  1. 4. git status: all the current path differences between working directory, staging index area, local repository, and remote repository if you have configured a remote one.
  1. 5. git log: all the commits which were created on a branch. It shows you the whole commit history including the hash, the author, and the date of the currently active, which means checked-out local branch.

Initializing with git:

By initializing a Git repository (using git init) a hidden directory named “.git” is created:

This directory contains the index file, the local repository, and all the other information that is necessary for our project. Information about commits, remote repository if available, addresses, a lock which stores the commit history, et cetera.

 Adding (git add<file>):

As soon as we have created the new file or modify the file in the working directory, we have to add this file to the staging, also called the index area.

Chapter 3.2:

Commiting and Pushing

Commiting (git commit):

Pushing (git push):

Chapter 3.3:

Cloning, Fetching, Merging and Pulling

Cloning a Repository

Chapter 4.1:

Getting Started with Branches

Chapter 4.2:

Rewriting the history of a branch

Chapter 5.1:

Resolving Conflicts

Chapter 5.2:

Cherry Picking, Resetting & Reverting

Chapter 6:

Git Branching Strategies

Chapter 7:

The Most Popular Git Repository Managers

The Most Popular Git Repository Managers: –

     Pure get cloud hosting services and others are there to be self-hosted git services.

1. Github.com:

2. gitlab.com:

3. bitbucket.org (Stash) :

4. gitbucket.github.io:

5. gogs.io:

6. gitea.io:

Self-hosted Git service: A Git Repository Manager which is hosted on one own server.

A Git Repository manager is used for: for collaborative development.

Chapter 8:

Further Learning Resources

Further Learning Resources: –

  1. 1. Pro Git (Second Edition 2014) Book
  2. 2. Collection of interesting links on git: simonberner.com/Git
  3. 3. Tutorials at conferences workshop on how to set up and configure your own git remote repository manager

Final tips: –

1. Commit often: small commits with specific intent to solve a problem are much more reproducible than big commits.

2.  Don’t commit unfinished tests to make them work and then commit them with a proper working commit others can pull it down and take it from there in case you are away before.

3.  Before commit, test your tests: it can be quite embarrassing when you have to fix your tests short after you have committed and pushed.

4.  Write clear commit messages: Commit messages are the documentation of your work.

5.  Agree on a workflow: As a Team define your workflow how you want to collaborate on a project.

Happy Learning 🙌



Exit mobile version