Question: I consider to use git (for web development) and watched a lot of lessons at lynda.com and read some blog posts for now. But there is one question I couldn't find an answer or don't understand how it works.

I've got a web server, a repo on a local server and a repo on my local machine.

What if I commit a change to the local server/web server that has been updated (by another team member) while I was working on that file? Will there be a warning? Will it automatically merge? Will it overwrite the file?

For example: I edit some CSS and PHP files and forget to update my local files before. What happens when I commit those files to the local sever where the files are newer?

Answer: 
When you push to a remote in git (aka your servers), if the sequence of commits between your local version of the branch and the remote version isn't linear, then the push will be rejected (the ever-so-annoying "non-fast-forward" issue). If you want to avoid problems like this, the best thing to do is to make sure that you have the most recent version of the code on your servers before pushing. What I would do is the following:

Before pushing to a remote:
- `git remote update` fetches all of your remotes.
- If you have changes in your working directory, `git stash` will save them for now and clean your working directory.
- `git rebase origin/master` will apply the commits between `master` and the most recent common ancestor of `master` and `origin/master` to `origin/master` and move the `master` branch to this new location

Clearly, you can replace `origin` and `master` with your remote and branch of choice. Now, when you push you don't have to worry about non-fast forward issues, and you can be sure that you are dealing with the most updated version of the code before you push.

Alternatively, you could set it up so that only one developer can push to the branch at your servers, so you don't have to worry about multiple people pushing to the servers: instead, one dev manages all changes to the server.
It will not overwrite the file. It might just apply both changes (yours and your team member's). If both modified the same portion of the file, there will be a conflict, which you must resolve then push again.