Dev.to · 1 min read

Introduction to Git : Beginner level

Introduction to Git : Beginner level

What is git? Git is the distributed version control system that tracks change in computer files , primarly used for coordinating work among the deveopers writing software source code. Types of version control: Local version control system. Centralized version control systrem. Distributed version control syatem. Basic Git Commands: git init – Initialise the working directory. git add - Adds the specified file to the staging area. git commit -m “write the message msg” - commit command helps to commit in history. git push origin main - push your file to the repository (github/gitlabs) – {assume when the remote is orgin and main}. git status – to find the status of the directory. git log – It is used to see the history of commit. Some additional useful commands: git diff – shows the older and new change. git rm --cached - remove the the file from git. git switch -c - to create a branch. git switch – to swtich between branches and main. git merge -to merge the branch. git stash - Temporarily saves uncommitted changes. git fork - personal copy of someone else's repository.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More Programming & Dev News