0% found this document useful (0 votes)
6 views

GITHUB

The document provides an overview of Git and GitHub, detailing their origins, functionalities, and installation processes. It explains key concepts such as repositories, commits, branches, and pull requests, emphasizing the collaborative features of GitHub for version control. Additionally, it outlines the steps for configuring Git, creating repositories, and pushing changes to GitHub, along with the importance of version control in software development.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

GITHUB

The document provides an overview of Git and GitHub, detailing their origins, functionalities, and installation processes. It explains key concepts such as repositories, commits, branches, and pull requests, emphasizing the collaborative features of GitHub for version control. Additionally, it outlines the steps for configuring Git, creating repositories, and pushing changes to GitHub, along with the importance of version control in software development.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

GIT AND

GITHUB
Linus Benedict torvalds

Creator of Linux kernel and


distributed version control
INTERESTING FACTS ABOUT LINUS TORVALS
• In early 1991, unhappy with MS-DOS and MINIX, Torvalds wanted to buy a UNIX system. Luckily for
us, he didn’t have enough money. So he decided to make his own clone of UNIX, from scratch.

• Till 2005, (then) proprietary service BitKeeper was used for Linux kernel development. When
Bitkeeper shut down its free service, Linus Torvalds created Git on his own because none of the
other version control systems met his needs.

• “Talk is cheap. Show me the code.”


― Linus Torvalds

The first ever announcement


of linux by Linux Torvals.
WHAT IS
GIT AND
GITHUB??
GIT




GITHUB



What is
GitHub?
• GitHub is a collaboration platform built on top of a distributed version
control system called Git. One does not have to worry about losing data
on his hard drive or managing a project across multiple computers -
one can sync from anywhere. You can track issues, build & test the
things and finally deploy.
Why Use of GitHub for Projects?
• Version Control (Allows experiments and mistakes without messing up
in final product)
• Keep your Code in One Place
• Great Collaboration Platform
• Git, GitHub, GitHub.com, GitHub Desktop,
• Key Terms:Repository: Storage space for projects (local or remote).
• Commit: Snapshot of changes with a unique identifier.
• Branch: Parallel version for divergent development.
• Merge: Combining changes from different branche

Repository:
Display images of local and remote repositories.
Commit:
Diagram showing a commit with changes and its unique identifier.
Branch:
Illustration of the main branch and a feature branch diverging.
Steps to Install Git
• Subtitle: Installation Process
• Step 1: Download Git
⚬ Provide the URL for the official Git website (https://git-scm.com/).
⚬ Include a screenshot of the website or the download page.
• Step 2: Run the Installer
⚬ Explain the installation process on different operating systems
(Windows, macOS, Linux).
⚬ Include visuals of the installation wizard or command line.
• Step 3: Configuration (Optional)
⚬ Mention that configuration steps can be done during installation or
later.
⚬ Briefly touch on setting up user information and default text editor.
Steps to Install GitHub Desktop

Step 1: Download GitHub Desktop


⚬ Provide the URL for the official GitHub
Desktop website
(https://desktop.github.com/).
Step 2: Run the Installer
⚬ Explain the installation process on different
operating systems (Windows, macOS).
⚬ Include visuals of the installation wizard or
process
Verification:

Check Installation:
• Open your command line interface or terminal.
• Type git --version and press enter.
• You should see information about the installed Git version.
Check Configuration:
• Type git config --list to see your Git configuration settings.
• Verify that your user information is correctly configured.
CONFIGURINGGIT
InthecontextofGit,"configuration" referstothesettings
andpreferences thatdeterminehowGitbehavesonyour
system.Gitconfiguration involvescustomizingvarious
aspectsoftheversioncontrolsystemtosuityourneeds.
Thisconfiguration isstoredinthreelevels:system,global,
andlocal.
SystemConfiguration: GlobalConfiguration: LocalConfiguration:
Thislevelisrepository-specific
This level applies system- Thislevelisspecifictoauserand
andonlyappliestothecurrent
wide and affects all users on appliestoallrepositoriesforthat Gitrepository.Local
the machine. It is user.It'stheplacewhere configurationsoverrideglobal
typicallyusedforsettingsthat youmightsetyourusernameandemail,which
configurationsforthatspecific
shouldareusedtoidentifyyour repository.
commits. git config --global user.name "Your Name" git gitconfiguser.name"YourName"git
bethesameforallusers. configuser.email
"your.email@example.com" "your.email@example.com"
git config --system core.editor
"nano" ᶜᵒⁿᶠᶦᵍ ⁻⁻ᵍˡᵒᵇᵃˡ ᵘˢᵉʳ.ᵉᵐᵃᶦˡ
Configuring Git is important because it allows you to personalize your Git
environment and ensure that your actions, such as commits, are
associated with the correct identity. It also allows you to set preferences
for the Git command-line interface, such as the default text editor, merge
tools, and more.
You can view your Git configuration at any level using the git config command without
anyarguments.Forexample:
git config --global --list
CREATINGGITHUBREPOSITORY
To initiate a new Git repository, we use the command “git init”. git init
it initializes version control in your project.
When we run “git init”, Git creates a hidden folder called .git in our project's
directory.
It stores all the information needed to track changes, manage versions,
and
collaborate effectively.
This .gitfolder iswhat makesyour projectofficiallyaGit repository.
Create a pull request to propose and collaborate on changes to a repository. These
changes are proposed in a branch, which ensures that the default branch only
contains finished and approved work.
It enables developers to propose changes to a project, review those changes, and
integrate them into the main codebase.
You can create pull requests on GitHub.com, with GitHub Desktop, in GitHub
Codespaces, on GitHub Mobile, and when using GitHub CLI.
A pull request is initiated from the branch to the original project's repository.

It is a request to merge the changes from the branch into the main codebase.
steps involved in creating a pull request:
1.Forktherepository.
2.Clonetheforkedrepositorytoyourlocalmachine.
3. Create a new branch for your changes.
4.Makeandcommityourchangestothenewbranch.
5. Push the changes to your forked repository.
6. Open a pull request from your forked repository to the original repository.
After initializing a pull request, you'll see a review page that shows a high-level
overview of the changes between your branch (the compare branch) and the
repository's base branch. You can add a summary of the proposed changes,
review the changes made by commits, add labels, milestones, and assignees,
and @mention individual contributors or teams.
BRANCHING
Git is a distributed version control
system used to track changes in
source code.
Branching allows you to work on
different versions of your project
simultaneously.
Create a new branch: git branch branch_name

Switch to a branch: git checkout


branch_name

List all branches: ᵍᶦᵗ ᵇʳᵃⁿᶜʰ


Making Changes in a Branch:
git add .
git commit -m "Your commit message"

Push changes to remote repository:


git push origin branch_name
Mergechangesfromabranchtothemainbranch
locally:
git checkout main
git merge branch_name

Push changes to remote repository after merging:


git push origin main

GitHub is a code hosting platform for version control and collaboration. It lets you and
others work together on projects from anywhere.

In layman language it acts as our portfolio where we can upload our work and projects

For better understanding


let us take an example:
Why Github?
⚬ Github is a website that allows developers to store and
manage their code using Git .

⚬ Git is a version control system .

⚬ Version control system helps us to track changes in a code .


Advantages of Git
COLLABORATIVE FEATURES
Steps for creating a new
repository
click on top right

Your profile

Repositories create new


PUSHING TO GITHUB
git push
• It uploads all local branch commits to the corresponding remote branch.
• It updates the remote branch with local commits.
• It is one of the four commands in Git that prompts interaction with the remote
repository. You can also think of git push as an update or publish.
• By default, it only updates the corresponding branch on the remote.
• So, if you are checked out to the main branch when you execute the git push, only
the main branch will be updated.
• It's always a good idea to use git status to see what branch you are on before pushing
it to the remote.
How To Use git push
• After you make and commit changes locally, you can share them with the remote
repository using git push.
• Pushing changes to the remote makes your commits accessible to others whom
you may be collaborating with.
• This will also update any open pull requests with the branch that you're working
on.
• As best practice, it's important to run the git pull command before you
push any new changes to the remote branch.
• This will update your local branch with any new changes that may have
been pushed to the remote from other contributors.
• Pulling before you push can reduce the amount of merge conflicts you
create on GitHub - allowing you to resolve them locally before pushing your
changes to the remote branch.
Common Usages And Options For git push
• git push -f: Force a push that would otherwise
be blocked, usually because it will delete or
overwrite existing commits.
• git push -u origin [branch]: Useful when
pushing a new branch, this creates an
upstream tracking branch with a lasting
relationship to your local branch.
• git push --all: Push all branches.
• git push --tags: Publish tags that aren't yet in
the remote repository.
THANK
YOU!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy