While introducing Git in the previous tutorials, we have learned What is Git and why to use Git. After that, our next step will be obviously to know how to use Git so that we can start using it. Git can be used through two different methods with three different sub-methods. Both ways have their own advantages and drawbacks. Git can be used via:
- GUI software
Git through Shell
Shell as you must have already known is used for accessing the operating system services. These include checking the network through ping or telnet function. Shell has many different functions and a shell is used through a command-line interface. Git can be used in two different ways on any operating system through shell. These are
- Git Bash
- Git CMD
When Git was developed it was coded in a similar way to use it on a command line. Originally developed for the Linux Kernel project, the idea was the same originally. Bash as you know is the terminal of any Linux OS. Git Bash is the bash that runs the Git commands on it. It is similar to the Unix shell with the same commands as of Linux. You can operate git from Git Bash on any operating system.
A Git bash will look like this with a few commands.
Git CMD is used on Windows. If you are familiar with the command prompt i.e. the shell used on Windows then you can use this one to run Git. Git CMD is nothing but CMD which can run Git commands. Although you can use it, the most recommended method is the Git bash. The reason being CMD is confined to Windows only. It will confine your knowledge to Windows only.
Git through GUI
Git GUI is using Git with the help of a graphical interface. This will diminish your shell usage and everything for which you were writing a command, you will now press some button or do it through the mouse. Using Git on a shell is always preferred among the developer community. Also, the big tech giants like Google, Amazon, etc uses Git on the command line because of its advantages and security. Advantages including that there are some features on a shell that are not available to GUI like ssh tunnel connecting to the remote server etc. Also, command line will let you automate your Git work. Some features are first released to command line also before the GUI and some of them don't even release to GUI at all. All in all, GIT on a shell is more powerful than on the GUI.
To make you more familiar with using Git, we will brief you a little about the various Git clients. This will also help you to decide which one to use for yourself but in this complete course, we will be using Git bash because of the above-stated reasons.
It allows you to execute Git commands in conjunction with Unix commands in a Windows environment. This tool will be downloaded automatically when you install GIT. Or you can install it from the Git Downloads page.
It allows you to execute Git commands in a traditional Windows Command Prompt type environment. You also get the option of selecting Git CMD while installing Git.
A desktop application that lets you visualize the files under version control, modified files, difference between them and commit messages corresponding to them in addition to host of other features.
Alternating to Git GUI which lets you visualize your Git repository and its history. Git Desktop allows you to do pretty much the same things as Git GUI. It is used mainly to use the history and commits in a bird's eye view, repositories at one place, etc. This tool is provided by GitHub and you can download it from the Git Desktop page.
EGit plugin in Eclipse
This is a wonderful tool that integrates directly with Eclipse IDE. EGit Plugin facilitates version control using Git in Eclipse IDE. EGit serves a huge community of Eclipse which needs version control native to their development environment. You can download EGit plugin from the Eclipse Market Place.
Source tree is yet another GUI tool that removes the command line interface and gives a beautiful user experience for Git. Source tree gives a unique colorful experience that is appealing to the other GUI clients. Source tree has unique features which tell which commits are ahead and behind the remote branch. There are more features of source tree that can be learned here. You can also download the software from the same page.
Git Bash and Git cmd come bundled as part of Git installation. Other clients can be downloaded as per one's requirements from here also.
As mentioned above, we will be using Git bash for this course. It is convenient, fast, and has numerous other advantages for a developer that will be required to learn Git in a better way. Head over to the next tutorial to learn How to create Git Repository.