[go: up one dir, main page]

0% found this document useful (0 votes)
45 views24 pages

Fundamentals of Git & GitHub

The document provides an overview of Git and GitHub, including basic terminologies, setup instructions, and how to work with repositories. It explains key concepts such as version control, commits, branches, and the process of pushing and pulling changes. The content is aimed at helping developers understand the functionality and usage of Git and GitHub in software development.

Uploaded by

Umayna Tanveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views24 pages

Fundamentals of Git & GitHub

The document provides an overview of Git and GitHub, including basic terminologies, setup instructions, and how to work with repositories. It explains key concepts such as version control, commits, branches, and the process of pushing and pulling changes. The content is aimed at helping developers understand the functionality and usage of Git and GitHub in software development.

Uploaded by

Umayna Tanveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Fundamentals of Git &

GitHub

Host : Muhammad
Hassan
Who Am I ???
Muhammad
Hassan
• Azure AI Dev, Android App Dev
• BS CS @UET
• What is Git && GitHub
• Basic Terminologies
• Setup Git and GitHub
Agenda
• Starting with Git
• Working with Repositories
Locally
• Working on another
developer’s repository.
• Version Control System
(VCS)
• Repository(Repo)
• Commit
Terminologie • Merge
s • Pull Request(PR)
• Fork
• Clone
• Push
• Pull
For Windows and MAC OS:
• Go to https://git-scm.com/downloads
• Download the software according to your
OS
Setup • Install git by using default settings
Git
For Linux:
• Use command
sudo apt-get install git
What is Git?

Git is a fast, versatile, highly scalable, free, open-source VCS. Its


primary author is Linus Torvalds, the creator of Linux.

Git is distributed version control system used to track changes in source


code during software development. It allows multiple developers to work
on the same project simultaneously and efficiently manage changes and
merge code and track version history
# sets up Git with your name
git config --global user.name "<Your-Full-
Name>"

First Time Git # sets up Git with your email


Configuration git config --global user.email "<your-
email-address>"

# makes sure that Git output is colored


git config --global color.ui auto
Git & Code
Editor
#VS Code Setup
git config --global core.editor "code
–wait”

Review Git
Configuration
#Lists all the configuration
properties
git config --list
How Git works?

Working Staging Area Local Repository

Directory
$ git add new-text-
file.txt
How Git works?

Working Staging Area Local Repository

Directory
$ git add new-text-
file.txt

$ git commit –m
“Message”
How Git works?

Working Staging Area Local Repository

Directory
$ git add new-text-
file.txt

$ git commit –m
“Message”
Working with Git
Commands
Git Add

$ git add <file1> <file2> … <fileN>

$ git add .

This command moves your changes to the


staging area.
Working with Git
Commands
Git Commit
$ git commit –m “Initial commit”
This command moves your changes to the local repository.
Try to always write your commit message in an imperative way.

$ git status
This command display’s the status of the working directory and the
staging area.
Git Commit
Message
Do’s
Keep the message short (less than 60-
ish characters)
Explain what the commit does (not how
or why!)

Don’ts
Explain why the changes are made
Explain how the changes are made
Use the word “and”
What is
GitHub?
Github is a web based platform built around Git that
provide centralized location for developer to store,
Collaborate and manage their Git repository.

It offers additional features such as issue tracking,


project managements and integration with various
third party tools
Repository(Repo):
A repository is like a folder where your project lives. It holds
all the code files, the history of changes, and all the different
versions of your project.

Commit:
A commit is like taking a snapshot of your code at a certain
point. It saves the current state of your project. You usually
add a message to describe what changes you made.
Branch:
A branch is like a copy of your project where you can make changes without
affecting the main version. Once you’re happy with your changes, you can merge
them back into the main branch.

Merge:
Merging means combining the changes from one branch into another. It’s like
putting together all the updates and making sure they work well together.

Pull Request (PR):


A pull request is like asking someone to review your changes before they are
merged into the main project. It’s a way to make sure everything is correct before
finalizing it.
Push:
Pushing is like uploading your changes from your
computer to GitHub so others can see them.

Pull:
Pulling is like downloading the latest version of
the project from GitHub to your computer. It
ensures you have the most up-to-date code.
How Git works with GitHub?

Working Staging Area Local Repository Remote Repository

Directory
$ git add new-
text-file.txt
$ git commit –m
“Message”

$ git push
How Git works with GitHub?

Working Staging Area Local Repository Remote Repository

Directory
$ git add new-
text-file.txt
$ git commit –m
“Message”

$ git push

$ git pull
How Git works with GitHub?

Working Staging Area Local Repository Remote Repository

Directory
$ git add new-
text-file.txt
$ git commit –m
“Message”

$ git push

$ git pull
Any Questions ..!!

Thanks !

You might also like