Step 6: Git Clone/ GIT Version Control

GIT Clone

triangle-exclamation
circle-info

Git private repository requires SSH access. There, confirm that your hosting package has SSH enabled. Use Cpanel as example, you can use cPanel's Terminal interface or any SSH client to access the server.

  1. Generate an SSH Key: If you haven't configured an SSH key, generate it using the following command:

ssh-keygen -t rsa -b 4096 -C "username@example"

Replace "username" with your cPanel account username and "example" with the domain name. Press Enter without entering a passphrase.

  1. Verify SSH Key: Confirm that the key exists and is in the correct location:

cat ~/.ssh/id_rsa.pub
  1. Register SSH Key: Follow your private repository host's instructions to register your SSH key. For GitHub: Log in to your GitHub account, navigate to your private repository's Settings. Under Deploy keys, copy the SSH key that show at step 2 into Key.

triangle-exclamation
Deploy keys
  1. At the end, it should able to git clone directly from server, developer may git clone using terminal at the path directory u want, for example, if developer want to clone the branch backup-mapmama.com, then it can implement by

GIT Push / Pull

Before pulling changes from a branch, ensure that any local changes you've made are committed and pushed to the remote repository. This ensures that your local repository is up to date with the changes from the remote repository.

Git Push

Example

Git Pull

Example

Last updated