DEV Community

Cover image for Git and GitHub
Ashray Parmar
Ashray Parmar

Posted on

7 3

Git and GitHub

What is Git?

Git is a distributed version-control system for tracking changes in source code during software development. It creates a local repository in our computer in which we will make local changes.

What is GitHub?

It is a place where your Local Repository can be uploaded to Remote Repository on GitHub.

Requirements?

We need to create an account on GitHub, now it is time that we push our local data to a remote location at GitHub.

Git Commands

Let's begin with the most used git commands.

Where will you type the commands? Open terminal with the project path;

  • git init

This will initialize a local repository in your project folder.

  • git add .

This command will add the project files in the staging area which will be ready to commit or push in GitHub.

  • git status

This will check whether your files are in Staged area or not?

What is staged area?

The staging area is a container where git collects all changes which will be part of the next commit it collects all the changes to be committed collectively before they will be pushed to GitHub.

  • git commit

Commit set a message about the changes you were done. The commit also saves a revision of the code and you can revert the code to any version anytime in one click. We can always add commit message by this command git commit -m "fix" this message is used if any bug is fixed in the code.

  • git push/pull

git push command is used to transfer or push the commit, which is made on a local branch in your computer to a remote repository like GitHub.

git pull is a Git command used to update the local version of a repository from a remote, suppose if any other developer made changes in the remote repository by this command you can update it to your local repository.

Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay