Recent Posts
- jQuery attrAugust 12, 2021
- jQuery mouseenterAugust 9, 2021
- jQuery ToggleclassAugust 6, 2021
- jQuery attr
GIT is a very popular version controlling method and a source code management tool which is used to keep a track of all the changes that have been made in the source code of the program. It has made the life of software engineers quite easy as it is used to track only the changes in one or more than one files. It is used to collaborate among the software engineers as every engineer is working on their code within their branch and can push their code to merge into the master branch thereby creating a complete code solution. The goals as to why it has been among the very popular tools are due to its integrity, speed and that it supports all the non-linear workflows of a distributed manner. The GIT directory present on every computer is in itself a complete repository which is not the case with many client-server systems operating today. While using with GIT bash there are some commands which should be known to you. In this post, we are going to discuss those commands.
Basic GIT Commands
The basic commands are as follows.
git config –global user.email “[email address]”
git init [repo name]
git clone [URL]
git add (filename),
git add *
git commit –m [type in a message]
Giving a message text at the end of the commit command helps in identifying the details about the commit code.
git commit -a
git diff
git diff -staged
git diff [first branch] [second branch]
git reset [file]
Intermediate GIT Commands
The intermediate commands are as follows.
git rest [commit]
git reset –hard [commit]
git status
git rm [file]
git log
git log –follow [file]
git show [commit]
git tag [commitID]
git branch
Git branch [branch-name]
Advanced Commands
The advanced commands are as follows.
git branch –d [branch name]
git checkout [branch-name]
Tips and Tricks
A file which is most commonly ignored is a ~/.gitconfig file which is the git’s global configuration file and contains quite useful commands. Many settings can be modified/altered as per your wish by making use of this command. You can turn particular command options off or on based on your choice and can also set the aliases.
Another crucial point to mention is about the visualization of the commit graph which comes in very handy when you are working on some project which consists of a lot of branching structures.
Conclusion
The best way to memorize these commands is by making frequent use of them. Don’t worry, if you don’t have an official project, you can clone any repo from the stash and start working on GIT to get hands-on experience and a nice flavor.
MCP is the right place for best computer Courses institute and advance Courses in Mohali and Chandigarh.The Complete Programming Academy can change your life – providing you with the knowledge, skills, and performance in a second language which helps you to excel in your job.You can also Contact us for 6 month industrial training institute in Mohali.