How to use Git and GitHub without making any chaos !!

Kiran RathodKiran Rathod
2 min read

Hello everyone, nice to meet you.

I am happy for you to be a part of our company.

abhi tak to pata Chal hi gaya hoga ki hum kya padhne vale hai 😅…

Git -

Git is basically a VCS, which stands for Version Control System. We use Git to track our code and maintain a history of it.

How Git do that?

Git keeps everything in the .git folder. This folder is not visible; it's a hidden folder.

To track any file, use these commands:

  • git init - This initializes your folder for Git.

  • git add - After initializing, you need to add the files to start tracking them. If you're adding one file at a time, can we use a single command to add all files? Yes.

  • git add . - This command adds everything.

  • git commit -m "message" - When you finish working on your feature, commit your changes and write a meaningful message in your commit to make it easy to understand.

Can you see what a small workflow looks like?

Do you know what an ID’s in the Git?

An ID is essentially a unique hash code that represents your commit file. Every time you make a commit in Git, it generates a distinct hash code for that specific commit. But you don't have to use any hash code, so relax.

Branches :

You know there are multiple developers in our company, and they work on different features within the same project. We use separate branches for each developer.

You can't commit to the main branch because it's locked. The main branch is the single source of truth.

we can not change any think without checking commits.

If you are working, you can do this too.

When you commit, you should create a pull request.

We are assigning a token to you, indicating that you are working on it.What is a token? It is essentially a small task or bug that needs to be fixed.

0
Subscribe to my newsletter

Read articles from Kiran Rathod directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Kiran Rathod
Kiran Rathod

. 5'8 | Explorer 🍁.. .NIT ALLABHAD || CSE’27 … .Dreaming - Chasing - Building🎶.. .Adventure seeker" 🌍