Monday, June 13, 2016

Create a git repository for the app

We will install git on our server to initiate a git repository in the app's directory. If you already have git installed, you can skip to the git repository initiation steps.

Install git on the server


To install git on the server, connect to the VPS as the root user using Terminal and run the following command:

# yum install -y git

Initiate git repository


1. In a Terminal window, connect to the VPS as the single user (not root):

$ ssh username@example.com

2. Change directories to the new app's home directory:

# cd /home/username/public_html/test-app

3. Initiate a git repository in this directory with the following command:

# git init

4. Configure the global username for the new repository:

# git config --global user.name "Your name"

5. Configure the global email for the new repository:

# git config --global user.email youremail@email.com

6. Add all of the current files in the directory and sub-directories to the repository:

# git add .

7. Commit the addition of the files to the repository with a commit message:

# git commit -m "Initial git commit"


Previous post: Creating the new Rails app on the web server

Next post: Configure the app's database file

No comments:

Post a Comment