0% found this document useful (0 votes)
7 views11 pages

Github Project S

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

Github Project S

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

2023

NIIT PROJECT
Documentation

COURSE: GITHUB
BY: AKINMULERO PRIESTLY
PROJECT TOPIC: DOCUMENTATION ON GIT AND GITHUB

Note: THIS PROJECT WAS GIVING BY OUR SUPERVISOR MR TEGA


Table of Contents
1. Identifying the Need for Version Control

 Local Version Control System


 Central Version Control System
 Distributed Version Control System

2. Working with Git

 Configuring Git
 Creating a Repository
 The Git Workflow
 Saving Changes
 Inspecting a Repository

3. Branching in Git

 Creating Branches
 Checking out Branches
 Merging Branches
 Differences Between Branches
 Deleting Branches

4. Git Commands

 Git init
 Git status
 Git add
 Git commit
 Git push

5. What is GitHub?

 Steps in Pushing a Project to a Repository


 Terminologies in Git
4. GitHub in Depth

 Version Control
 Repositories
 Collaboration
 Issues and Bug Tracking
 Branching and Merging
 Pull Requests (PRs)
 Continuous Integration (CI) and Continuous Deployment (CD)
 Wiki and Documentation
 Security and Access Control
 Community and Social Features
 Licensing and Legal Considerations
 GitHub Desktop and Mobile Apps
Identifying the Need for Version Control
Local Version Control System
Local version control systems are the simplest form of version
control, typically used in a single-user environment. Developers
manually track changes to files, often creating backup copies or
renaming files to indicate different versions. While
straightforward, it lacks collaboration features and can lead to
confusion and errors.

Central Version Control System


Centralized version control systems address the limitations of
local systems by introducing a central repository accessible to
multiple users. These systems offer better coordination and
version tracking. However, they can create bottlenecks as all
changes must go through the central server. Examples include
CVS and Subversion (SVN).

Distributed Version Control System


Distributed version control systems, like Git, take a different
approach. Each user has their own local repository, allowing
offline changes. This decentralization enhances collaboration
flexibility, as users can work independently and synchronize
changes when needed.

Working with Git


Configuring Git
Before using Git, configure it with your personal details and
preferences, including your name and email address used to
identify your commits. Git allows both global and repository-
specific settings to tailor the tool to your needs.

Creating a Repository
A Git repository stores project files and version history. You can
initialize a new repository or clone an existing one from a
remote source (like GitHub). Creating a repository is the first
step in tracking changes to your project.

The Workflow
Understanding the basic Git workflow is crucial for effective
version control. It involves stages like staging changes (using 'git
add'), committing changes (using 'git commit'), and pushing
changes to a remote repository (using 'git push'). This workflow
helps you track your project's history and collaborate with
others.
Saving the Changes
When making changes to your project, commit those changes.
Commits are like snapshots of your project at a specific point in
time and should include meaningful commit messages
describing the changes.

Inspecting a Repository
Git provides tools for inspecting a repository's history and
changes. You can view the commit history (using 'git log') and
see differences between versions (using 'git diff'). These tools
help you understand your project's evolution and troubleshoot
issues.

Branching in Git
Creating Branches
Branching in Git allows you to work on different aspects of your
project simultaneously. Create separate branches for specific
tasks or features to prevent conflicts and organize project
management.
Checking out Branches
Checking out branches allows you to switch between different
branches in your Git repository, focusing on one task at a time.
Use the 'git checkout' command for this purpose.

Merging Branches
After completing work on a branch, merge it back into the main
branch (usually 'master' or 'main'). Merging combines changes
made in the feature branch with the main branch but can lead
to merge conflicts that need resolution.

Differences Between Branches


Use the 'git diff' command to understand the differences
between branches. This helps identify changes made on one
branch compared to another, valuable for troubleshooting and
code review.

Deleting Branches
As your project progresses, some branches may no longer be
needed. Deleting branches that have served their purpose
keeps the repository clean and manageable, following best
practices for branch management.
Git Commands
git init: Initialize a Git repository in your project.
git status: Check if files in your project are tracked.
git add: Add untracked files to be pushed.
git add "name": Add a specific file.
git add .: Add every file in a folder.
git add -A: Add only untracked files.
git commit: Send added files to a staging area with a commit
message.
git push: Send data to your remote repository.

What is GitHub?
GitHub is a web-based platform for software development and
collaboration. It's widely used for version control, project
management, and team collaboration. Here are the steps in
pushing a project to a GitHub repository:

Create a GitHub account and install Git on your machine/PC.


Create a local Git repository in your project folder using the 'git
init' command.
Add a new file to the project, and use 'git status' to check which
files are tracked.
Add an untracked file to the staging area using 'git add'.
Create a commit using 'git commit -m' with a meaningful
message.
If needed, create a new branch for changes or features.
Create a repository on GitHub to track your code. While not
required, it's essential when working with a team.
Push the code to GitHub to allow others to make code changes.
Use 'git push origin' followed by your branch name.
Terminologies in Git
Check-out: Use 'git checkout' to switch branches in a
repository.
Clone: Copying a repository or the action of copying a
repository.
Fork: Create a copy of a repository, with changes made by the
original owner reflected in the forked repository.
Master: Refers to the primary branch of all repositories.
Merge: Combining changes from one branch into another.
Origin: Git uses 'origin' as a system alias for fetching and
pushing data.
GitHub in Depth
Version Control
GitHub primarily uses Git, a distributed version control system,
allowing developers to track changes, collaborate, and revert to
previous versions.
Repositories
Repositories are core building blocks, containing project files,
documentation, and version history, with options for public or
private access.
Collaboration
GitHub enables seamless collaboration among developers and
teams, supporting multiple simultaneous contributors.
Issues and Bug Tracking
Built-in issue tracking helps report bugs, suggest features, and
organize tasks. Issues can be assigned and labeled.
Branching and Merging
Developers create branches for features or bug fixes without
affecting the main codebase. Merging integrates changes when
ready.
Pull Requests (PRs)
PRs propose merging changes from one branch into another.
They include discussions, reviews, and automated checks.
Continuous Integration (CI) and Continuous Deployment (CD)
GitHub integrates with CI/CD tools for testing, building, and
deploying code changes automatically.
Wiki and Documentation
GitHub offers a wiki feature and built-in README.md for
project documentation, including hosting documentation on
GitHub Pages.
Security and Access Control
GitHub provides security scanning and access control settings to
protect repositories.
Community and Social Features
Users can star repositories, fork for modifications, engage in
discussions, project boards, and code reviews.
Licensing and Legal Considerations
Specify the project's license, dictating how others can use and
distribute your code.
GitHub Desktop and Mobile Apps
Besides the web interface, GitHub offers desktop applications
for Windows and macOS and mobile apps for iOS and Android.
In summary, GitHub is a powerful platform supporting collaborative
software development, version control, and project management. It's used
by individuals, open-source projects, and organizations to streamline
development workflows and foster collaboration in the software
development community.

You might also like