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

Assignment of Github

A GitHub repository is a directory or storage space for projects, either locally or online. It can contain code, text, image, and other files. By default a repository is public, but it can be made private which requires a paid account. Branches allow diverging from the main development line without affecting it. The default branch is the base for new pull requests and commits. The commit command creates a unique ID for changes made, while the pull command fetches and downloads remote content. The merge command integrates separate development branches back into a single branch. Forking makes a copy of a repository for experimentation without affecting the original, while cloning gets a local copy of a remote repository to sync between locations.

Uploaded by

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

Assignment of Github

A GitHub repository is a directory or storage space for projects, either locally or online. It can contain code, text, image, and other files. By default a repository is public, but it can be made private which requires a paid account. Branches allow diverging from the main development line without affecting it. The default branch is the base for new pull requests and commits. The commit command creates a unique ID for changes made, while the pull command fetches and downloads remote content. The merge command integrates separate development branches back into a single branch. Forking makes a copy of a repository for experimentation without affecting the original, while cloning gets a local copy of a remote repository to sync between locations.

Uploaded by

Hammad Rao
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

GitHub Repository:

A directory or storage space where your projects can live. Sometimes GitHub users shorten this to “repo.”
It can be local to a folder on your computer, or it can be a storage space on GitHub or another online host.
You can keep code files, text files, image files, you name it, inside a repository.

By default a GitHub repository is public which means that anyone can view the contents of this repository
whereas in a private repository, you can choose who can view the content. Also, private repository is a
paid version.

GitHub Branches:
Git Branching - Branches in a Nutshell. ... Branching means you diverge from the main line of development
and continue to do work without messing with that main line.When you create a repository with content
on GitHub, GitHub creates the repository with a single branch. This first branch in the repository is the
default branch. ... Unless you specify a different branch, the default branch in a repository is the
base branch for new pull requests and code commits.

Branches serve as an abstraction for the edit/stage/commit process. You can think of them as a way to
request a brand new working directory, staging area, and project history. New commits are recorded in
the history for the current branch, which results in a fork in the history of the project.

Commit Command:
A commit, or "revision", is an individual change to a file (or set of files). It's like when you save a file, except
with Git, every time you save it creates a unique ID (a.k.a. the "SHA" or "hash") that allows you to keep
record of what changes were made when and by who.

The git commit command is one of the core primary functions of Git. Prior use of the git add command is
required to select the changes that will be staged for the next commit. Then git commit is used to create
a snapshot of the staged changes along a timeline of a Git projects history.

Pull Command:
The git pull command is used to fetch and download content from a remote repository and immediately
update the local repository to match that content. Merging remote upstream changes into your local
repository is a common task in Git-based collaboration work flows.
Merge Command:
Merging is Git's way of putting a forked history back together again. The git merge command lets you take
the independent lines of development created by git branch and integrate them into a single branch. Note
that all of the commands presented below merge into the current branch.

A merge happens when combining two branches. Git will take two (or more) commit pointers and
attempt to find a common base commit between them. Git has several different methods to find a base
commit, these methods are called "merge strategies".

Cloning and Forking GitHub Repository:

 Forking
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes
without affecting the original project.
 Cloning
When you create a repository on GitHub, it exists as a remote repository. You can clone your
repository to create a local copy on your computer and sync between the two locations.
 Difference between Cloning and Forking
Forking is a concept while cloning is a process. Forking is just containing a separate copy of the
repository and there is no command involved. Cloning is done through the command 'git clone'
and it is a process of receiving all the code files to the local machine.

You might also like