How to set up a git repository between a website server and a local computer?

This are the steps to set up a repository between a website hosted on a server and a folder on your local computer.

First, git must be set up on both the server and the local computer

On the local computer, it’s easy, I just installed Github and that was it. I had created a logon on the github website first, so I entered the same credentials in the software when asked.

On the server, it’s a whole new world. Hope I’m brave enough for it!

How to set up git on the server side

Actually, when people say this, they mean something much simpler than it sounds. They mean “how to simply give git access to the server”.

Indeed, git needs to jump through the authentication hoops to be able to read, track, and modify files on the server.

The safest way to do this is to give git the key to the server.

Allow the server to respond to security tokens

Servers need to be configured to make this possible. Indeed, by default, they don’t allow access to tokens. So you have to head to your server provider’s website, log in to your account, and navigate to the domain of the website you manage. From the dashboard, a tab or link shows “SSH/FTP” access, that’s where you can activate the option (usually free) to allow connection to the server by a remote user without requesting the password every time thanks to a token or key.

Hmm. At this point, after some searching, I realized it was necessary to perhaps install what’s called a “local server environment” on my own computer. After all, that’s what’s needed to be able to emulate or pretend your local computer is a server when reviewing and working on the website.