Git Cheatsheet

Git Cheatsheet

ยท

2 min read

What is Git?

Git is a modern and widely-used distributed version control system in the world. It is developed to manage projects with high speed and efficiency. The version control system allows us to monitor and work together with our team members in the same workspace.

It is a Version Control System for tracking changes in computer files and coordinating work on those files among multiple people.

It is primarily used for source code management in software development, But it can be used to keep track of changes in any set of files.

Why Git?

  1. Open Source

  2. Scalable

  3. Distributed

  4. Security

  5. Speed

  6. Branching

Most Commonly used git commands

1. Initializing Git

git init

image.png

2. Adding files to Git

To add all files to git

git add .
git add *

image.png

image.png

To add a specific file

git add filename.extension

image.png

3. Status of git repository

git status

All files in that directory are tracked

image.png

If some of the files are not tracked

image.png

4. Getting help

git help

image.png

5. Committing changes to the git repository

git commit -m "Initial commit"

image.png

6. Adding a remote repository

git remote add origin https://github.com/username/reponame.git

image.png

7. Pushing the code to the remote repository

 git push -u origin master

image.png

Follow for more

Linkedin: https://www.linkedin.com/in/prahladinala/
Github: https://github.com/prahladinala/
Instagram: https://instagram.com/prahlad.inala/
Twitter: https://twitter.com/prahladinala
Figma Community: https://www.figma.com/@prahladinala
Dribbble: https://dribbble.com/prahladinala
Behance: https://www.behance.net/prahladinala
Personal Portfolio: https://prahladinala.in
ToolMate: https://toolmate.co.in

Thank you!

Did you find this article valuable?

Support Prahlad Inala by becoming a sponsor. Any amount is appreciated!

ย