Git Commands Every Developer Should Know


Git Clone

Copies an existing repo to a new directory at a different location.  git clone [repo url]

Creates a checkpoint and new feature without altering the original project.    - Create a new branch  git branch [branch]    - Delete a branch  git branch -d [branch]

Git Branch

Git Add

Adds changes in the working directory to the staging area, preparing them to be included in the next commit.   git add [filename]

Saves changes permanently with a message. It allows for accumulating major changes on a local level before pushing them to the global level.   git commit -m "Your Commit Message"

Git Commit

Git Status

Displays the current status of the repository, such as untracked files, added files, changed files, etc.   git status

Git Pull

Fetches and merges the changes from the remote repository in the cloud into the local system.   git pull

Git Config

Sets configuration values on a global or local level, such as the author name and email ID with commit.   git config -global "[name]"

Git Reset

Undo the committed changes from a repository without changing file contents.   git reset

Git Merge

Merges two distinct branches into one single branch.   git merge [branch name]

Are you  ready to become a Git guru?

Look no further! From cloning repositories to merging branches, learn everything you need to become a Git pro in no time with this blog by InterviewBit.

Step Up Your Game with InterviewBit Web Stories

Don't miss out on the chance to upskill yourself with IntervewBit's engaging web stories.