• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Setting Up Git on Ubuntu 14.04

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
9
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Step 1: Installing Git
  2. Step 2: Configuring Git
  3. Committing
    1. Step 1: Creating a folder
    2. Step 2: Adding your files to Git
    3. Step 3: Committing one or more files
  4. Want to contribute?


Git is a popular system for version management. It’s pretty simple to install. In this guide, we’ll see how we can install Git on Ubuntu 14.04.

Step 1: Installing Git

We can install Git without having to add any repositories.

apt-get install git

Step 2: Configuring Git

Git works best if you give it some basic information: your name and your email address. You can set these options in Git with the following commands:

git config --global user.name "John Appleseed"
git config --global user.email "[email protected]"

Committing

The whole idea of Git is committing, so you can see the changes in each commit. For example, these could be a couple of commits:

  • Added class.php
  • Fixed example.php
  • Fixed variable in calendar.php

You can view these in Git.

Step 1: Creating a folder

First, create a directory for your project:

mkdir ~/git
cd ~/git

Now create a couple of files, like:

touch example.html && touch index.html && touch contact.html

You can now start the process of making this a Git project by executing the git init command while in the project directory:

cd ~/git
git init

This will return the following response (assuming that ~/git refers to /home/test/git).

Initialized empty Git repository in /home/test/git/.git/

Step 2: Adding your files to Git

Every time you create a new file and you want it to be included in Git, you need to tell Git that you want it to keep track of that file. For example, if we were to create a file called calendar.php and we would want to add it to Git, we would type:

git add calendar.php

Assuming that you are in the same directory as where the file you want to add (calendar.php) is.

The problem with this is that you have to add each file manually. For example, if you already have a couple of files (in our case example.html, index.html and contact.html), you would need to add these 3 manually. With 3 files, that isn’t a huge task, but if you had more files, then it would take a considerable amount of time. Luckily, we can use . which adds all files not currently in Git:

git add .

Step 3: Committing one or more files

Congratulations, you’re ready to commit! Committing is the process of telling Git you’ve made a number of changes and it should put them in the “changelog”. After all, that’s the whole point. In order to properly use commits, we must add a commit message. This allows you to keep track of all the changes. This can be anything you want; it’s good practice to use something that you will understand though.

git commit -m "Initial commit" -a

Congratulations! You can now use Git on your VPS.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Run Your Own Arma 3 Server on Ubuntu 14

Next Post

Using Screen on Ubuntu 14.04

Next Post

Using Screen on Ubuntu 14.04

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet