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

Git & Github

Uploaded by

gibeb94284
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Git & Github

Uploaded by

gibeb94284
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

BY HARSH KUMAR

WHAT IS GIT & GITHUB?


• Git is a distributed version control system (DVCS) designed to handle
everything from small to very large projects with speed and efficiency.

• GitHub is a web-based platform that helps developers store, track, and collaborate on
software projects. It uses Git, an open-source version control software that allows
multiple people to make changes to web pages simultaneously.

2
WHY TO USE GIT?
CONFIGURING GIT
• Git config --global username “my name”
• git config --global user.email “[email protected]
• git config -- list
GIT COMMANDS
• git init –b main
• git add ./<file_name>
• git commit –m “Message”
• Git log
• git status

5
WHY TO USE GITHUB?

6
CREATING REPOSITORY
ON GITHUB
1. In the upper-right corner of any page, select , then click New repository.
2. Type a short, memorable name for your repository. For example, "hello-world".
3. Optionally, add a description of your repository. For example, "My first repository on GitHub.“
4. Choose a repository visibility.
5. Select Initialize this repository with a README.
6. Click Create repository.

7
GIT TO GITHUB

Pushing local repo to remote repo


• Git remote add origin <url>
• git remote -v
• git push origin
• git push –u origin

8
CLONING
• Cloning a repository from Remote to our local system.

• git clone <link>

9
FORKING
• Forking is a process of making a rough copy of
some repository

10
BRANCHING
• git branch <branch_name> -- new branch

• git branch –M main (to rename branch)

• git branch –list all branches

• git checkout <branch_name>

• Git branch –d<branch_name>

11
MERGING
• git diff <branch_name>
• git merge <branch –name>

12
UNDOING CHANGES
Case 1: when changes are saved
git checkout<file name>
Case 2: when changes are staged
git reset<file name>
Case 3: when changes are commited (one commit)
git reset HEAD~1
Case 4: more then one commit
git reset <commit_hash>
git reset –hard <hash>
13
THANK YOU

14

You might also like