•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
    • Status
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Linux Command Line Tutorial For Git

  • Home
  • Client
  • Knowledgebase
  • Linux
  • Centos 7
  • Linux Command Line Tutorial For Git

Table Of Content

    Related Articles

    • How to configure IP's On Centos 7?
    • Installing MariaDB on Centos 7
    • How to install the GCC compiler in CentOS 7?
    • How to Install SSL Certificate On Centos 7
    • How To Install Git On Centos 7
    • Installation of Lamp Stack on CentOS 7
    • Yum Update Not Working on Centos 7

    Linux Command Line Tutorial For Git

    Publisher: Psychz Networks February 11,2019

    For creating your identity on GIT you need to have Git on your system. If you have already installed Git on your system, kindly follow the tutorial below.
    If not, you can find the steps for installing Git on your system (CentOS 7) on the following link https://www.psychz.net/client/kb/en/how-to-install-git-on-centos-7.html

    Now, since you have Git on your system, you’ll want to do a few things to customize your Git environment. We will learn how to create your Identity on Git.

    Git comes with a tool called git config that lets you get and set configuration variables that control all aspects of how Git looks and operates.

    How to create your identity on Git

    First, you need to set your user name and email address with Git.

    Note: Your username and email id are very important as every Git commit you to make uses this information.

    git config --global user.name "your_name"
    git config --global user.email your_email@abc.co

    Checking your Git setting

    To check your Git setting, issue the following command in your terminal.

    git config --list

    Cloning a Git repository

    First, you must clone the git repository for your project to start with and only then you can commit your changes.

    git clone https://158.179.XXX.XXX/demo/abc.git

    With the help of the above command, you can clone a Git repo on a server. Here we specified the server IP address along with the path and 'abc.git' is the name.

    Initializing a new Git repository

    If you want to start your own git repository server for your codebase, issue the following command

    git init

    This will initiate a new git repository and the machine/host can be now used as a git repository server for that particular codebase. You can access the newly created repository by using the host’s IP or hostname.

    Adding a new file to Git repository

    Let us now see how to add a file to our newly created Git repo.

    Before we create a demo file, you must go to your working folder and run following command

    vim demo.txt

    Add the following line to the demo.txt file.

    "This is a demo copy of your demo file."

    NOTE: Type ":wq" to save and exit

    Our demo file has been created. Next, add this newly created file to the index of the Git repo by issuing

    git add demo.txt

    Now, we need to commit this to your Git repo. This can be done

    git commit

    This will add the file “demo.txt” with its file content.

    Push the changes to the repository

    git push

    This will push the changes into the master branch.

    Deleting a file from Git

    To delete a file from Git just do the following one after another.

    git rm demo.txt
    git commit -m "demo.txt file removed"
    git push

    You are done removing demo.txt from your git repository.

    Views: (1517) Votes: (0)

    Related Articles

    • How to configure IP's On Centos 7?
    • Installing MariaDB on Centos 7
    • How to install the GCC compiler in CentOS 7?
    • How to Install SSL Certificate On Centos 7
    • How To Install Git On Centos 7
    • Installation of Lamp Stack on CentOS 7
    • Yum Update Not Working on Centos 7
    Copyright © 2026 Psychz Networks,
    A Profuse Solutions Inc Company
    Hosting Services
    • Catalog
    Infrastructure
    • iColocation
    Compute
    • cMetal
    • cVirtual
    Storage
    • sObject
    • sBlock
    Networking
    • nIP Transit
    • nWavelength
    Protection
    • pBackup
    • pDDoS
    Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
    Policies
    • Acceptable Usage Policy
    • Privacy Policy
    • Service Level Agreement
    • Terms and Conditions
    Support
    • Community
    • Knowledge Base
    • Open A Ticket
    • Status
    Get In Touch
    • Psychz Networks,
      A Profuse Solutions Company
      611 Wilshire Blvd #300
      Los Angeles,California 90017
      USA
    • US/Canada: 800-933-1517
    • International: 626-549-2801