In our previous tutorial, we showed you how to create and sync a GitHub repository to your Ubuntu VPS server. Using the last tutorial as a springboard, we’ll continue on and show you how to commit and push a script from your Ubuntu server to your GitHub account.

Step 1: Create a File

After we SSH into our server, open a terminal and cd into the folder we created in the previous article. In this folder, we will create a simple JavaScript program.

vim helloworld.java
public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}

helloworld

Step 2: Checking our New Script’s Status

Next, using the following command, you’ll see that the helloworld.java file is highlighted in red indicating that the data has not yet been committed to our GitHub account.

git status

Example Output:

java.highlighted

#tutorials #git environment #git repo #linux #ubuntu

Committing and Pushing to GitHub from Ubuntu
1.10 GEEK