Git
GitLab login details sagarika.vardhan@gmail.com Vardhan@123
Github Information Security
Github is a provider of repository hosting service and popular version control using
Gitlargest host of source code with 40million user and more than 190 million repositories
as of Jan 2020
Github is widely used for open-source development due to its effective collaboration feature
Github provides a web-based gui with effective role-based access control and policies for
restricted access and several collaboration feature
Along with features like fork,clone,branch,pull and merge request Github actions makes it
easy to automate software workflows with CI/CD,build,test and deploy code with Github
We should not Upload secure/sensitive files(like exposed API token/private keys) to Github
Never use unsecure ,searchable public repositories to store work related artifacts
Posting code even for a short duration on public repository leads to data leakage
Githhub sagarika.vardhan@gmail.com username:sagarika1961 password:Rayan@1961
Git is a Distributed Version Control System (DVCS) as well as it is a Source Code Management
System (SCMS) which is used as a track that changes the file also allows to revert back to any
particular change.
version control systems means For example, if you have a file on which you’ve been working on and
reworking for a long time, all the versions of it are saved in Git, and you can easily get back to every
version
Original author (Developer): Linus Torvalds Released on: 7 April 2005
How does it work?
Most version control systems work by calculating the differences in each file, and then by summing
up these differences they can reach whichever version saved, but that’s not the way Git works.
Git functions as a series of snapshots for your file system. Every time you change something in your
files committing it, or just saving the state of your project, Git takes a picture of the whole system
and saves a reference to it. If there’s a file that hasn’t been changed, then it stores a reference to the
previous snapshot.
When you are working with Git, you have two repositories - Local & Remote.
Local repository: It is just a file location residing in your system. When you git
commit your code, a version/snapshot is created in your local repo.(Local system)
Remote repository:A remote repository generally lies somewhere outside your
system, on a remote machine. This is very important when you are working with
multiple people. This is the place where everyone will be sharing their code.
(GitHub)
https://www.rainforestqa.com/blog/2014-05-28-version-control-best-practices
Why Git?
Easy file recovery.
It helps us to find the history of the changes created along with the information of the
person who created it.
It can roll back to the previous working state.
Almost everything is local and after the final changes, we can push it to the remote
server.
Git creates snapshots to track files. Taking a snapshot basically means recording your
files at any given point of time.
Working with Git
Step1:Download GitBash from https://git-scm.com/ (https://www.youtube.com/watch?
v=BMW7LiF_Oc4)
Step2: Check git –version in cmd
Step3: Generate SSH key
How to setup SSH key in GitLab SSH –
Secure Shell - Used for authentication - By setting ssh key you can connect to GitLab server
without using username and password each time
Step1:Run command ssh-keygen( On Mac - run command on terminal On Windows - use
putty or git bash )
Step 2: Login to GitLab Gotot account > Settings > SSH Keys Step
Step 3: Copy contents of id_rsa.pub and Add Key Step
Step 4: Verify SSH key is added
Step4: Follow Git Operation File