Git and Github

Git and Github

A help guide for all the newbies who want to learn about git and GitHub. I have used simple layman's language to things easy and simple.

What is Git? Git is a free, open-source distributed version control system. It keeps track of projects and files as they change over time with the help of different contributors. Allows developers to work simultaneously. Git helps keep track of changes made to a code.

Version control system Version Control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

Types of VCS Local version control system Centralized version control system Distributed version control system

Features of Git Open-source Speed Easily recover files Staging area (space where git stores its changes) Saves time Track Changes Rollback to pre-working space

**Terms ** Clone: Brings a repository that is hosted somewhere like Github into a folder on your local machine.

Add: The git add command is used to add file contents.

Commit: It is used to record the changes in the repository. A series of commits comprises the Git history.

Push: Pushing is the art of transferring commits from your local repository to a remote repository.

Pull: It fetches and merges changes from the remote from the server to your working directory.

Directory: folder

Terminal or command line: Interface for text commands.

CLI: Command-line interface

Repository: It is commonly referred to as a repo, which is a collection of source code.

Local repository: Git local repository is the one on which we make local changes, typically this local repository is on our computer.

Remote repository: Git remote repository is one of the servers, typically a machine situated away.

Github Github is a git repository hosting service. It is famous for project collaboration. More than 1 person can work on the project at the same time. You can also contribute to public projects. It is a huge repository collection that has a web-based graphical interface. Contributors work together on projects by maintaining a repository (repository has committed to the project or a set of references to the commits) on GitHub. Github also facilitates many of its features, such as access control and collaboration it provides a web-based graphical interface. It offers both distributed version control and source code management (SCM) functionality of Git. It also facilitates some collaboration features such as long-tracking feature requests, task management, and Issue creation for every project. If you fork a project, that project comes into your repository then you can make changes and request the owner to merge changes. Every individual in the IT field should learn Github and maintain their work there. In the coming years, GitHub is going to be your new portfolio website.

** The local repository has three different virtual zones** Working directory Staging area Commit area

Working directory: It is the directory where new files are created, old files are deleted or changes are made to already existing files. Staging area: it is an area where Git stores its changes, it is also called an index. Commit Area: When the changes are complete, the changing area will contain files that need to be committed. Creating a commit will cause Git to take the new code from the staging area and make the commit to the main repository. This commit is then moved to the commit area.