Step 1: Install Git on the Server Ensure Git is installed on your AntOS Linux server: Update your package list: sudo apt update Install Git: sudo apt install git Verify the installation: git --version Step 2: Initialize a Git Repository Navigate to the directory: cd /usr/www/mywebpage Initialize a new Git repository: git init Step 3: Set Up GitHub Repository Create a new repository on your GitHub account via the GitHub website. Go to GitHub and click New Repository. Name the repository (e.g., mywebpage) and create it. Copy the repository's URL (e.g., https://github.com/username/mywebpage.git). Step 4: Connect the Local Repository to GitHub Add the remote URL to your local repository: git remote add origin https://github.com/username/mywebpage.git Verify the remote URL: git remote -v Step 5: Set Up Git Configuration Set your Git username: git config --global user.name "Your Name" Set your Git email: git config --global user.email "your.email@example.com" Step 6: Add Files and Make the Initial Commit Add all files in the /usr/www/mywebpage directory: git add . Commit the files: git commit -m "Initial commit" Push the changes to GitHub: git push -u origin master Step 7: Automate Git Updates (Optional) You can automate pushing changes using a script: Create a script (e.g., /usr/www/mywebpage/update_git.sh): #!/bin/bash cd /usr/www/mywebpage git add . git commit -m "Update on $(date)" git push origin master Make it executable: chmod +x /usr/www/mywebpage/update_git.sh Run the script whenever you make changes: ./update_git.sh Step 8: Set Up SSH for GitHub (Recommended) To avoid entering your password every time, use SSH authentication: Generate an SSH key (if not already created): ssh-keygen -t rsa -b 4096 -C "your.email@example.com" Copy the public key: cat ~/.ssh/id_rsa.pub Add the key to your GitHub account: Go to GitHub > Settings > SSH and GPG Keys > New SSH Key. Paste the key and save. Update the remote URL to use SSH: git remote set-url origin git@github.com:username/mywebpage.git Test the connection: ssh -T git@github.com phrase: testing