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

gitandgithub

The document provides an overview of Git and GitHub, explaining Git as a distributed version control system that facilitates collaboration among developers. It outlines key concepts of Git, basic commands, and the collaborative workflow on GitHub, including forking repositories and submitting pull requests. Additionally, it highlights best practices for using Git and GitHub effectively, along with the benefits of using these tools for project management and teamwork.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

gitandgithub

The document provides an overview of Git and GitHub, explaining Git as a distributed version control system that facilitates collaboration among developers. It outlines key concepts of Git, basic commands, and the collaborative workflow on GitHub, including forking repositories and submitting pull requests. Additionally, it highlights best practices for using Git and GitHub effectively, along with the benefits of using these tools for project management and teamwork.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Git and Github

Suhas A

2 0 3 0
1

3
Hello
,
4

5
I’m Suhas
GDG Web3 Lead

6
Topics Covered:
7
What is Git?
8
Why use Git?
9
Basic Git commands
Overview of Github
Collaborating on Github
Basic Activity on forking and submitting a pull request
1 GIT
What is git?
2 Git is a distributed version control system that tracks
changes in code, allowing multiple developers to
collaborate efficiently. It manages project history,
3 enables branching and merging, and helps revert or roll
back changes if needed. Git is essential for coordinating
4
teamwork and maintaining code integrity across
different environments.
5 It was initially developed by Linus Torvalds
(2005) who is also the founder of linux
operating system.
6

7
Why use git?
8

9 Git is essential for tracking code changes,


collaborating with others, and managing project
history. It allows you to work on new features
without affecting the main code, revert mistakes
easily, and ensures everyone stays in sync. Git
keeps projects organized and secure, making
development faster and more efficient.
Key git concepts
1 Repository (Repo): A project’s storage that tracks all changes.
2 Commit: A snapshot of changes, saved to the repository.
Branch: A separate line of development, allowing work on new features without affecting the main
code
3
Merge: Combines changes from one branch into another.

4 Clone: Creates a copy of a remote repository on your local machine.


Staging Area: A place where changes are prepared before committing.
5
HEAD: A pointer to the latest commit in the current branch.
6 Revert/Reset: Tools for undoing changes, either by creating new commits or rewriting history.
7 Push/Pull: push uploads a commit to a remote repository, while pull fetches and merges changes
from it.
8 Remote Repository: A remote repository is a Git repository hosted on a server that allows
collaboration and code sharing.
9
1
What is GitHub?
• A web-based platform for version control and collaboration.
2 • Built on top of Git to manage and store code repositories.
Key Features:
3
Repository Hosting: Store and manage Git repositories online.

4 Collaboration: Multiple developers can work on the same project simultaneously.


Branching and Merging: Create branches to work on features and merge them back.
5 Pull Requests: Propose, discuss, and review changes before merging.

6
Issues and Project Management: Track bugs, feature requests, and tasks.
Actions and CI/CD: Automate workflows, testing, and deployment.
7
Security: Provides code scanning and vulnerability alerts.
8
Benefits:
9
• Facilitates open-source contributions and teamwork.
• Offers project visibility, making it easy to share and collaborate.
• Acts as a backup for your code, ensuring data is not lost.
Collaborating on github
Basic workflow of how opensource collaboration works in github:
1
1. Fork the Repository
2 2. Clone the Repository
3 3. Create a Branch

4 4. Make Changes and Commit


5. Push Changes to GitHub
5
6. Open a Pull Request (PR)
6 7. Review and Merge

7 8. Sync with Main Branch

9
Best practices :
1. Write Clear Commit Messages
1
2. Commit Often, But with Meaning
2

3
3. Use Branches for Features and Fixes

4 4. Keep Pull Requests Small and Focused


5
5. Review Code Before Merging
6
6. Sync Regularly with the Main Branch
7
7. Use Issues for Task Tracking
8
8. Protect the Main Branch
9

9. Leverage GitHub Actions for Automation

10. Maintain a Contributing Guide


Fork and PR Activity:
1 1. Fork the provided github repository: https://github.com/suhasamaresh/gdgpractivity

2 2. Add your name and usn to the readme file and commit the changes the forked repository

3 3. Review the changes and open a pull request .


4
4. If the changes made are correct , the admin will merge the pull request to the main repository
5

9
Basic git commands:
1. git init: Initializes a new Git repository in the current directory.

2. git clone <repository-url>: Creates a local copy of a remote repository.

3. git status: Shows the current status of your working directory, including changes to be committed.

4. git add <file>: Stages changes (adds them to the next commit).

5. git commit –m “message”: Records the staged changes to the repository with a descriptive commit message.

6. git push: Uploads your changes to the remote repository.

7. git pull: Fetches and merges changes from the remote repository into your local branch.

8. git log: Shows the commit history of the repository.


1

3
Thank
4

5
you
6
Connect with me
7

8
https://www.linkedin.com/in/
LinkedIn:
suhas-amaresh-a5a431228/
9

You might also like