Step 6: Git Clone/ GIT Version Control

GIT Clone

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.

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 clone -b backup-mapmama.com [email protected]:techkoson/mapmama-vue-laravel.git

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

git add .
git commit -m "Your commit message"
git push origin <your-branch-name>

Example

git add .
git commit -m "Update From mapmama.com 14/3"
git push origin backup-mapmama.com

Git Pull

git pull origin <your-branch-name>

Example

git pull origin backup-mapmama.com

Last updated