GIT AND
GITHUB
This workshop offers essential skills for
version control and collaborative
development.
Amit Kumar
Mentor GSSOC 2024
WHAT IS GIT ?
• Git is a CLI ( Command Line Interface) based tool which is used for taking snapshots
 of each and every version of your code.
• Git is like an allrounder in a team, If you mean mess up with git is there to cover up.
• Git can go back in time, can save your work repeatedly many more. It is by far most
 used tools by the developers.
VERSION CONTROL SYSTEM
• A version control system (VCS) is a tool that helps manage and track changes to files
 over time.
• It is essential for collaborative projects, ensuring that all team members work on the
 latest version, avoid conflicts, and maintain a history of edits. Whether using tools like
 Git or cloud-based platforms.
• VCS provides a streamlined way to handle updates, rollbacks, and collaboration
 effectively."
DID YOU KNOW ?
GIT INSTALATION AND CONFIGRATION
WORKFLOW OF GIT
VERSION CONTROLLING WITH GIT
INTIALIZING GIT PROJECT
• To verify installation, open a terminal and run:
• Run the following command to initialize a Git repository:
ADDING FILES TO VCS
• To track files, add them to the staging area:
INTRODUCTION TO COMMIT
• A commit is a snapshot of the changes made to the files in the at a specific point in
 time.
• Commits store information about what was changed . Who made the change, and
 when it was made.
COMMITING FILES
• Command to Commit Files Individually
STAGGING AREA
• The staging area is a space where Git stores changes before committing
 them.
• It allows you to review and control what changes will be part of the next
 commit.
LOGGING COMMIT HISTORY
 • How you can display and manage commit history in Git
GITHUB
• GitHub is a cloud-based platform where you can store, share, and work
 together with others to write code.
• GitHub is a platform for hosting code that allows for version control and
 collaboration.
• Its name was chosen as a compound of Git and hub.
REPOSITORIES
• Repo = Repository
• A folder like structure containing all your
 necessary files.
• Can contain folders, images, files, etc. ,
 anything you want.
BRANCH
• The branch concept in GIT is like you can create a branch to work on new features
 of fix issues without disrupting the main code.
• If your changes in the branch are good , you can merge them into the main code. If
 not, You can make improvements without affecting the main codebase.
PUSH
1. Uploads Local Changes to Remote Repository
 • The git push command is used to send local commits and changes to a remote
 repository.
2. Keeps Remote and Local Repositories in Sync
 • It ensures that the remote repository stays updated with the latest local changes,
 enabling collaboration among team members or syncing your work across different
 devices.
PULL
• Git pull is a command which is used to fetch and integrate the changes which are present in the remote
 repository to the local repository.
• It will fetch the changes and merges with the repository.
 Syntax
 git pull [remote-name] [branch-name]
 FORK
• A fork on GitHub is a copy of an existing repository that allows you to make changes
 without affecting the original project.
• Fork is making a copy of a repo.
 PULL REQUESTS (PR)
• A pull request (PR) in GitHub is a proposal to merge changes from one branch into
 another in a repository.
• Pull requests act as a checkpoint that ensures only thoroughly reviewed and tested
 code makes its way into the main branch.
 OPEN SOURCE DEVELOPMENT
What is open source ?
 • Open source is a term that refers to software that is created and shared with the
 intention that anyone can: View the source code, Modify the code, and Distribute
 the code.
 Key Features
 • Transparency, community-driven development,
 and freedom to customize.