I am planning to use GitHub to manage the code for my next website. Although I have used GitHub in the past, I have never used it to deploy a website. My rather unsophisticated plan is as follows:

[![enter image description here](https://i.stack.imgur.com/v7xfw.jpg)](https://i.stack.imgur.com/v7xfw.jpg)

However, I have several concerns about this model:

1. If I am using `git pull` on my remote server, does that mean my website directory itself will become a git repository? If so, is there a way I can avoid this? For instance, could I create a `/var/repo` directory to contain the git repository and then "copy" the code over to the actual website directory (`/var/www`)? Is there an efficient way to set this up?
2. Let's assume I run `git pull` for the first time and deploy the website on my server. Next, let's assume I *edit* an existing file and *add* a file directly on the server via FTP. When I run `git pull` for the second time, how will git handle these two files? Will my edited file be replaced and my new file be deleted? Will my edited file be replaced and my new file untouched? Will I not be able to run git pull at all?
3. Let's assume I have a file named `config.php` on my computer that contains the usernames/passwords for the various users that can access my databases. Since `config.php` on my computer is configured for my localhost environment, when I use `git pull` on my server for the first time I will have to edit the variables. As such, when I run `git pull` for the second time, is that file on my server replaced with the localhost version again?
4. As a followup to the last question: what would be the best way to handle configuration files that contain data such as usernames and passwords? Not only do I want to hide this sensitive data from the public GitHub repository, but I also want to ensure that when I run `git pull`, the already-modified configuration files on my server remain untouched.