O
O
Oleg2017-03-09 20:20:24
git
Oleg, 2017-03-09 20:20:24

Website development using git. How to work correctly?

We develop websites mainly on Bitrix. The question arose of project control. The question is the following. How to set up git and how to work with it so that coders can code with their own sources (sass, gulp, etc.), and programmers work with their code, and so that data is sent to our server when pushing.
How is it implemented in other companies? I'm talking about the joint work of layout designers and programmers.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
P
Philipp, 2017-03-09
@r45her

To solve the problems that you have, you need to do 3 things, but systematically and smoothly.
1. Teach programmers about things like git. Wait a week. Then just loop through them - roll back those changes. Revert the changes. Well, 5 times, with the deadline yesterday. Anyone who does not use git will suffer for hours and days. Remind them how easy it is with git. Repeat the test after a while. Give an ultimatum: git or go look for a new job. By the way, each person should have their own separate account.
2. Keep the repository for the entire project. Make separate folders for layout sources, for the assembled layout and for the site itself. Layout designers work with their folders. They collect the layout and compress the assembled layout into a separate folder. Programmers through the commit history will be able to track changes and bring them back to the developed components.
3. Implement automated project deployment and disable file editing via FTP/bypassing git.
Well, in general, your problem is low qualification of personnel. It is solved by viewing YouTube and training developers. If someone does not want to study, the rate is slightly reduced, and the money is given to those who study. Even 500 rubles will be a great motivator.

A
Andrey Khokhlov, 2017-03-10
@andrhohlov

Bitrix recipe.
To ignore:

/bitrix
/upload

Move templates and components to the /local.
Place the layout for the template in its folder, ignore everything that you collect.
Including ignore the required styles.css, in which you collect styles.
It will look like this:
ab0b7b508154438fb6d21bb8c1032479.png

N
Nick8, 2017-03-09
@Nick8

You can look in the direction of such a git flow solution https://habrahabr.ru/post/106912/
Well, a utility that makes it easier to work with this approach https://github.com/nvie/gitflow

M
miruzzy, 2017-03-11
@miruzzy

Of course, I'm not a great expert (what am I talking about, I'm generally a student), but as for me, it should be like this:
1) Download and install the git client for yourself and the git server on the server.
2) Create a repository on your computer, write the first commit.
3) Next, send your repository to the server with the initialization function, thereby creating an external repository.
4) The layout team connects to the repository, clones it on the computer and, having created a branch for layout designers, switches to it.
5) The prog team does the same with their branch.
(The branches are specially so that there is no one team, there are no files of another team)
6) And that's it, work as you need. The branches can then be merged.
PS it's better to use ssh connection than putty. (as for me, it's easier for everyone to give out a key so that he doesn't bother with a login and password).
PPS
1) If you write under Windows, then create and initialize a local turnip using git-bash or git-gui (of course, gui is easier), and everything else can be easily done using Source Tree (there is only under Windows) .
2) Under linux, I just use git-gui.
I repeat once again, I'm far from an expert, but everything works like this for me :)

C
catanfa, 2017-03-16
@catanfa

if there is no experience with git, then the easiest way to start working is through a service that provides a convenient interface, helps with documentation, has a bunch of features, like Code Review and others. For example, github, bitbucket.

D
Dmitry Pacification, 2017-03-17
@dmitry_pacification

I don’t understand at all how any self-respecting proger or coder can now work without a git. I worked as a content manager, so I immediately had to learn git. Made minor edits to layout. And it’s a sin for progers to work without a git

R
Roman Morozov, 2021-10-13
@Q_BASIC

Here I analyzed the best practices for working with git in Bitrix
here setting up git and gitignor

A
Alex Bond, 2017-03-21
@AlexBond

We do not work in Bitrix in my company, but we have many different projects on self-writing and a couple of frames. The workflow will look the same for everyone:
1. The developer makes a fork of the company's turnip and codes there whatever he wants.
2. When he's finished hacking, he makes a pull request to the company's Gita.
3. One of the senior programmers goes over the commits and checks for any obvious nonsense.
4. The admin merges the request and builds the project via Gulp/Jenkins and pushes the changes via rsync to the staging server.
5. After passing the tests, the admin pushes through Jenkins / Gulp to the production server.
In principle, a fairly versatile workflow. We store all configs in .env files. Gulp always has a watch task that compiles everything in real time and thus speeds up the work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question