This question has already been answered:

I want to organize Git on the server and work with it. What is available:

  1. Locally Git Site

What do I want:

By making some changes locally, I make a commit, and let's say in SmartGit I press PUSH . Files are sent to the server and the pointer is automatically placed on the newly added commit, i.e., the site status is updated remotely.

Another point: the same files are on BitBucket , that is, you need to push files there and then from the local computer.

How to organize it? Starting with installing git on a remote server.

Reported as a duplicate by participants Nick Volynkin , aleksandr barakin , Visman , Max Mikheyenko , PashaPash 4 Oct '15 at 13:55 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • one
    good answer to a similar question: ru.stackoverflow.com/a/428514/178576 - aleksandr barakin
  • If I understand correctly, you want to deploy a site from your local Git repository. Noted double to the appropriate question and answer. - Nick Volynkin

1 answer 1

Git is installed on the server in the usual way, then the repository is initialized in the required folder with the git init command. Then remote repositories are added:

 git remote set-url origin --push --add <a remote> git remote set-url origin --push --add <another remote> 

If you still need to pull from these repositories, you must skip the --push option.