DEV Community

Ragul Kannadasan
Ragul Kannadasan

Posted on

Git

Git is a version control system. Git was created in 2005 by Linus Torvalds, the famous software engineer who also created the Linux operating system.

Git is open-source and free. This means anyone can use it, download it, and contribute to making it better.

If we are working alone, Git is great for keeping our files organized.But,when we work in a team, Git becomes essential.

Essential Git Commands

1.git init

Initialize a new Git repository

git init
Enter fullscreen mode Exit fullscreen mode

2.git clone

If a project already exists online,use this command to download a full copy of it to our local storage

git clone URL
Enter fullscreen mode Exit fullscreen mode

3.git add

Before we save a change, you need to tell Git which files to include.it's called staging.stage all modified files at once, use a period "."

git add .
Enter fullscreen mode Exit fullscreen mode

4.git commit -m "message"

The -m stands for message. Always write a short description of what we changed.

git commit -m "message"
Enter fullscreen mode Exit fullscreen mode

5.git push

use this command to upload our changes to a remote server.so team can access it.

git push
Enter fullscreen mode Exit fullscreen mode

Top comments (0)