AKZN Notes

Archives for My Lazy and Forgetful Mind

Tag: git

Deploy from GitHub to cPanel Using Webhook and Deployment Hook (No SSH Key)

Step 1: Set Up Git Version Control in cPanel: Log in to your cPanel account. Navigate to the "Git Version Control" section (or similar) and create a new repository or choose an existing one. Note down the repository URL provided by cPanel. This URL is used to push changes. Step 2: Configure GitHub Webhook: In […]

Git deploy to VPS

for the impatients Set up the new bare repo on the server: $ ssh myserver.com Welcome to myserver.com! $ mkdir /var/git/myapp.git && cd /var/git/myapp.git $ git –bare init Initialized empty Git repository in /var/git/myapp.git $ exit Bye! Add the remote repository to your existing local git repo and push: $ cd ~/Sites/myapp $ git remote […]

Untrack files already added to git repository based on .gitignore

Let’s say you have already added/committed some files to your git repository and you then add them to your .gitignore; these files will still be present in your repository index. This article we will see how to get rid of them. Step 1: Commit all your changes Before proceeding, make sure all your changes are […]

How to merge two git branches that are in different repos/folders?

Combining two git repositories Use Case I have: folder_a/app_A folder_b/app_B I want to merge app_B into app_A and keep all history. How can I merge the branches together? switch to repo A cd folder_a Add repo B as a remote repository git remote add folderb /path/to/folder_b Pull B’s master branch into a local branch named […]