Git and GitHub :
If you are in a software development industry then mostly likely you have git and github . Today gitHub is the most popular resource for developer to share the code and work on project togather. It’s free and easy to use and has become central in the moment towards open-sources.
GitHub:
GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.
GitHub is a service.
GitHub is a graphical user interface.
GitHub is hosted on the web.
GitHub is maintained by Microsoft.
GitHub is focused on centralized source code hosting.
GitHub is a hosting service for Git repositories.
Git:
Git is a distributed version control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Git is a software.
Git is a command-line tool.
Git is installed locally on the system.
Git is maintained by linux.
Git is focused on version control and code sharing.
Git is a version control system to manage source code history.
About version control and Git :
A version control system, or VCS, tracks the history of changes as people and teams collaborate on projects together. As developers make changes to the project, any earlier version of the project can be recovered at any time.
Developers can review project history to find out:
- Which changes were made?
- Who made the changes?
- When were the changes made?
- Why were changes needed?
VCSs give each contributor a unified and consistent view of a project, surfacing work that’s already in progress. Seeing a transparent history of changes, who made them, and how they contribute to the development of a project helps team members stay aligned while working independently.
In a distributed version control system, every developer has a full copy of the project and project history. Unlike once popular centralized version control systems, DVCSs don’t need a constant connection to a central repository. Git is the most popular distributed version control system. Git is commonly used for both open source and commercial software development, with significant benefits for individuals, teams and businesses.
check first git is install on you system or not
To see if Git is installed on your system, open your terminal and type
Get Kubra’s stories in your inbox
Join Medium for free to get updates from this writer.
$ git — version
If is already install in your pc continue the next step.
If is not install follow the instruction and install on you pc
Next step is configuration :
For configuration you have to enter your user_name and email_id by using the following commands
$ git config — global user_name <user_name>
$ git config — global user_email <user_email>
Next generate the SSH key:
$ ssh-keygen -t ed25519 -c “user_email”
About repositories
A repository, or Git project, encompasses the entire collection of files and folders associated with a project, along with each file’s revision history. The file history appears as snapshots in time called commits. The commits can be organized into multiple lines of development called branches. Because Git is a DVCS, repositories are self-contained units and anyone who has a copy of the repository can access the entire codebase and its history. Using the command line or other ease-of-use interfaces, a Git repository also allows for: interaction with the history, cloning the repository, creating branches, committing, merging, comparing changes across versions of code, and more.
Through platforms like GitHub, Git also provides more opportunities for project transparency and collaboration. Public repositories help teams work together to build the best possible final product.
Create repository:
Here you have to create a folder
$ mkdir git_project
$ cd git_project
Initialize git now:
$ git init ->Here are we are initilizing git .
$ git remote -v
$ git remote set-url <copy the url of your reposistory>
$ git branch -> It check you are on which branch.
$ git push origin master ->It push the master .
Git branches are effectively a pointer to a snapshot of your changes.
Stage & Commit Files
Think of Git as keeping a list of changes to files. So how do we tell Git to record our changes? Each recorded change to a file or set of files is called a commit.
Before we make a commit, we must tell Git what files we want to commit. This is called staging and uses the add command. Why must we do this? Why can’t we just commit the file directly? Let’s say you’re working on a two files, but only one of them is ready to commit. You don’t want to be forced to commit both files, just the one that’s ready. That’s where Git’s add command comes in. We add files to a staging area, and then we commit the files that have been staged.
$ add . ->this will keep all the untracked and modified file staged stage.
$ commit -m “commited” (This is nothing but a message) once you commit all the files will go the unmodified stage.
git status :
The git status command displays the state of the working directory and the staging area .








