A
A
Artem Kom2014-09-04 17:38:36
git
Artem Kom, 2014-09-04 17:38:36

How to set up Git to work on a local server?

Hello dear associates.
I have long wanted to install and configure a version control system for my project.
Given
There are two local machines on the same network. The programmer works for one, the front-end (me) works for the other. Everyone has a local version of the site on their machine. Each performs its own tasks, but it often happens that when working with files, the programmer and I can edit the same file (for example, a style file). The programmer works on a machine under the Windows operating system. I'm on Mac.
After I make any changes in the project (for example, I corrected styles or layout somewhere), I give these files to the programmer and he merges them with his copy. If the changes were made by the programmer, he gives them to me and I merge them with my copy. Checking them manually, looking for files that have been changed is not very convenient. I heard that such a task is much easier to solve using a version control system. In particular, I heard a lot about Git.
Git-hub does not suit by definition. Storing the files somewhere on the server is not an option. The files must be stored locally.
What do you need
Each of the developers should have their own local (working) copy, in which the current changes are made. After the changes are made, they are published to the main repository (also local). Further, the files from it will go to the server on the network.
I read on the net that a similar solution can be done using Git and Dropbox. This option would be fine. Plus, it is necessary that these tasks be managed using a graphical interface, and not the command line (I ask you not to fuss too much here, it's just one of the conditions).
What was done
I installed git on a mac. Installed Tower (GUI for Git for Mac). Created a local repository in the Dropbox folder. Like it even monitors changes in these files. But! It turns out that the site files themselves are in only one place (in this dropbox folder), and I need three copies (one for me, one for the programmer and one for the main / clean repository).
Question
How can I make sure that each of the participants has their own copy of the site? Is Git suitable for this at all? Where on the net can I find detailed instructions for solving my problem? What am I doing wrong? Or do I really want too much?
I hope that I have clearly described my task and someone can help with useful advice in my question. Thank you very much in advance.
UPD
The issue was resolved radically. The git didn't fit. I am using Mercurial. To work with the repository, there is a good Sourcetree graphical cross-platform interface (by the way, it also allows you to work with Git).
Such a bunch solves the problems described above.
Thanks everyone for the advice.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim Vasiliev, 2014-09-04
@qmax

Git is ideal for these purposes.
But it needs a third repository through which you will synchronize.
And, perhaps, the fourth repository, where the latest working (and not developed) version will be stored, which is posted somewhere.
Take the manual on git and study.
There is an option without additional repositories, for example, mercurial, or a hard-ass configured git. In this scheme, the repositories are synchronized with each other.
But at the same time, additional branches (heads) are automatically generated in each repository, which can lead to confusion faster than understanding the normal operation scheme.

S
Sergey, 2014-09-04
Protko @Fesor

Git-hub does not suit by definition. Storing the files somewhere on the server is not an option. The files must be stored locally.

You obviously don't know how GIT works. The files will be stored both on the server and locally. That is, when you do a git clone you are making a local copy of the repository. Complete. with all file versions. the remote repository is largely used for synchronization between developers. Locally, you are free to do whatever you want. There is an additional benefit. Having 3 copies of the repository, you can always restore everything, since the probability that both the server and both computers with local ones will come up is negligible.
So the options are: pay 5 bucks for an account on a github or start one on a bitbucket. Either draw lots for someone to deploy gitlab or deploy it somewhere else.

S
Sergey, 2014-09-04
@butteff

Install gitlab on your local server. Use git on your computers to work with it.
I can help you install and configure everything (on a commercial basis), completely turnkey from scratch to make you a server for web development. If you do it yourself, I am ready to help solve problems for free that will arise in the process, if any.

A
Alex Kheben, 2014-09-04
@zBit

Git flow to help you
And "naked" repositories
In general, you are not using git correctly. Why dropbox is not clear at all ...
You make a "naked" repository on some of your servers. Set up access to it via ssh for the necessary users or from one user, for example, from git. Next, clone this turnip for yourself and your proger clones the turnip for yourself. In total, we have 3 turnips: on the server, on yours and on your proger.
Next, make changes and don’t forget to pull and resolve conflicts before pushing.
Whoever merges last - he resolves conflicts.
In general, it is better to use git flow. I don’t know how you have a shitty utility, but in general there is such a tool (stupidly scripts). With them it is more convenient to release and the branches take on a more structured look.
Why are you making it difficult?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question