Master Git to Impress in Job Interviews
Git is the most popular version control tool for developers. Learn the 15 most common Git commands and how to use them to impress in job interviews.
Marko Denic
Software Engineer.
-
Want to impress in job interviews? Master Git.
— Marko Denic (@denicmarko) April 5, 2023
As a developer, it's essential to use version control, and Git is the most popular tool.
Here are the 15 most common Git commands: -
1/ git init
— Marko Denic (@denicmarko) April 5, 2023
Creates a new Git repository in the current directory, allowing files to be tracked and managed with Git.
Example: pic.twitter.com/D0Um1Rs3I8 -
2/ git clone
— Marko Denic (@denicmarko) April 5, 2023
Copies an existing Git repository to a new location on your computer, allowing you to work with the repository's files locally.
Example: pic.twitter.com/aNjUvnY180 -
3/ git add
— Marko Denic (@denicmarko) April 5, 2023
Adds changes to the staging area, preparing them to be committed to the repository.
Example: pic.twitter.com/f6a0o9dA8O -
4/ git commit
— Marko Denic (@denicmarko) April 5, 2023
Saves changes to the repository, creating a new commit that records the changes made to the files.
Example: pic.twitter.com/6LSTRjqzwZ -
5/ git push
— Marko Denic (@denicmarko) April 5, 2023
Uploads the local repository changes to a remote repository.
Example: pic.twitter.com/K7HwNaNqa1 -
6/ git pull
— Marko Denic (@denicmarko) April 5, 2023
Downloads changes from a remote repository to your local repository, merging them with your local files.
Example: pic.twitter.com/5xeU2jYv7z -
7/ git branch
— Marko Denic (@denicmarko) April 5, 2023
Displays or creates new branches within the repository, allowing multiple users to work on different parts of the codebase simultaneously.
Example: pic.twitter.com/1tYcXX56MJ -
8/ git checkout
— Marko Denic (@denicmarko) April 5, 2023
Switches between different branches, allowing you to work on different parts of the codebase.
Example: pic.twitter.com/8kxuLB5d90 -
9/ git merge
— Marko Denic (@denicmarko) April 5, 2023
Combines the changes from one branch into another, bringing in any changes that have been made since the two branches diverged.
Example: pic.twitter.com/FpcdkufVj4 -
10/ git log
— Marko Denic (@denicmarko) April 5, 2023
Displays a history of commits made in the repository, allowing you to see who made changes and when they were made.
Example: pic.twitter.com/ye93ntwwQS -
11/ git status
— Marko Denic (@denicmarko) April 5, 2023
Shows the current state of the working directory and staging area, indicating which files have been modified or added.
Example: pic.twitter.com/gzFNhZDBRE -
12/ git fetch
— Marko Denic (@denicmarko) April 5, 2023
Downloads changes from a remote repository to your local repository, without automatically merging them with your local files.
Example: pic.twitter.com/u4vfO9n8Ke -
13/ git reset
— Marko Denic (@denicmarko) April 5, 2023
Unstages changes in the staging area, allowing you to unstage a file or reset the staging area to a previous commit.
Example: pic.twitter.com/J8xxQvG1ud -
14/ git rebase
— Marko Denic (@denicmarko) April 5, 2023
Reapplies changes from one branch onto another, rewriting the project history and creating a linear sequence of commits.
Example: pic.twitter.com/npgPtm738V -
15/ git tag
— Marko Denic (@denicmarko) April 5, 2023
Creates a lightweight tag for a specific commit in the repository, allowing you to mark a significant point in the project history.
Example: pic.twitter.com/GS9ncWuGFm -
If you liked this thread, share it with your friends:https://t.co/hcdfzWzd6G
— Marko Denic (@denicmarko) April 5, 2023