Git is an important part of daily programming (especially if you're working with a team) and is widely used in the software industry. Since there are many various commands you can use, mastering Git takes time. But some commands are used more frequently (some daily). So in this post, we will see the 7 most used Git commands that every developer should know.
Note: To understand this article, you need to know the basics of Git.
git pull: In a folder, to pull the complete content of the repository to a particular folder.
Ex:- /test>$ git pull
git status: To see the present status of the git.
Ex:- /test>$ git status
git diff: To see what all changes have been done in all files.
Ex:- /test>$ git diff
To see what all changes have been done in a particular file.
Ex:- /test>$ git diff css/main.css
git checkout: To retain old values or content in the git.
Ex:- /test>$ git checkout
To retain what all changes have been done in a particular file.
Ex:- /test>$ git checkout css/main.css
git add: To add all changes have been done in the git.
Ex:- /test>$ git add .
git commit: To commit all changes have been done in the git with a message.
Ex:- /test>$ git commit -m 'fix: changes' .
git push: To push all changes have been done in the git to the server.
Ex:- /test>$ git push