There may be some confusion here, so I will try to clarify the situation.
A repository is just a copy of your code. You can have several copies of your code (for example, several copies of your repository, for example: one on your development machine, one on your testing server and one on your production server). It all comes from the same code, you just can have each repository with different commits (a set of changes) or another branch.
My suggestion would be to work like this. You create a repository with your code by running in the root directory of the project you want to use with git.
git init
Now you can create several branches of your code. One could be called a "master" (usually the name of a person), and it is used to store production code. Another branch can be called "development." So, when you start playing on your website, you will switch to the development branch in your local copy of your repository, make changes, commit this branch and push the changes to the repository on your test server (which you would normally save in the "development" branch ) You check your code, and then, when you feel that everything is in order, you merge development changes into master and then drag them into the production server repository (which is usually located in the "master" branch).
I highly recommend you use github.com , it can really simplify things, and also help you keep remote safe copies of your code.In addition, you do not need to create git servers to be able to make changes to every copy of your code, but you just update your copy of github, and later you can extract changes from each version of your code (e.g. testing and production).
Everything that I explained here can be a little confusing, you can check the book to understand the difference between the repository itself and the branch in the repository. git is a great choice for organizing your code. If you decide to go with him, you can take a look at this website http://gitimmersion.com/
acadavid
source share