Time for action – initiation in CLI mode

For those who like to hear the sounds of more keystrokes instead of clicks, there's always command-line interface (CLI) mode.

There has been a constant increase in the percentage of people who are quick with keyboard's key strokes, giving more priority to performing operations using keystrokes instead of mouse clicks wherever possible. This is also a main reason why Gmail introduced shortcut keys for almost all of its functions.

To create or initiate the repository using the command-line interface mode you need to do the following:

  1. Open your shell (command prompt in Windows or Terminal/Console in Mac/Linux).
  2. Go to your Workbench directory on your desktop using the cd (change directory) command.
  3. Once you are inside the Workbench directory type git init and hit Enter to complete the initiation process.
  4. You should get a status message from Git saying Initialized empty Git repository in your/path/to/Workbench/directory/goes/here.
    Time for action – initiation in CLI mode

Ah! The sound of keystrokes, so good to hear.

What just happened?

You have successfully commanded GIT to monitor our Workbench directory and its contents. Init is the operational keyword that initializes the repository.

Behind the screen

This initiation process will create a directory called .git inside our Workbench directory. This directory is usually made read-only and hidden by Git to safeguard itself from accidental deletion or tampering by users. It's the place where Git will hold all the history about your files and changes made to them.

So be careful with that directory; deleting it will wipe out the entire history of your files present in that directory.

Configure Git

Gear up your Git installation for usage by configuring it properly. There are several reasons why you should configure Git before starting to use it, but discussing all of them now would be premature, so we shall learn about them as and when the necessity occurs. For now, as a bare minimum configuration to get started, we will tell our name and e-mail address to Git so that it can log the changes under our identity.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.125.171