I recently settled on a new job, before that I didn’t work with git very much - I did everything alone. There are three of us in the team: 2 programmers and one coder. I read git-scm, githowto still have, perhaps stupid questions:

1) If I write code in windows, and the combat server is on nix, then set core.autocrlf true - right?

2) Is it necessary to Feature, Hotfix branches to push to the server, provided that 1 programmer works on each such branch? My thoughts are: I create such a brunch locally from develop, I work, reseis (or better merge / then delete the branch ???) with a local develop branch, push and bullet it already.

3) Any preparatory release work (change debug define from true to false, clear the cache, compress css, js) should be done as a separate commit in the release branch or does it go beyond git?

4) I understand correctly that git should not be on the combat server?

5) use git pull --rebase or git pull to simply update the changes made by other programmers in their branch? Is there a significant difference other than a more branched story?

Closed due to the fact that the issue is too general for the participants aleksandr barakin , HamSter , cheops , Kromster , fori1ton 24 Oct '16 at 7:58 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Half the questions will disappear when you start using PhpStorm - everything is done via gui. To understand how the storm did this or that action - open the log in the bottom panel. For the rest of the moments, everything is in git-scm, take a closer look - mihdan
  • four
    Bad advice. Gui need to be used maximum to see the state, but no more. Moreover, gui does not solve the above questions. Most similar programs still ask - rebuild or merge (or can we forcefully start?). - KoVadim
  • @mihdan Yes, I already use phpstorm and do update project and commit changes. I just wanted to understand everything in more detail. - GroZa
  • The question was closed, because in fact there are 5 different questions. It is better to set them separately, because 1) they all walk badly together, 2) it’s difficult to give detailed answers to everything at once. 3) it is not clear why the adopted answer worked. - Nick Volynkin

1 answer 1

1) If I write code in windows, and the combat server is on nix, then set core.autocrlf true - right?

set up your editor so that he would have the "correct" line feeds (linux). Then nothing will need to specifically change. Either use line breaks and select the default settings (there autocrlf = true, if I remember correctly). You can read more here .

2) Is it necessary to Feature, Hotfix-branches to push to the server

preferably if you want to work from home, and not just at work. It is also very convenient - for example, getting sick or lingering in a traffic jam - a colleague can take a branch and see, apply, modify. And maybe a screw sprinkle. If the branch is started, everything will be fine.

Rebase (or better merge / then delete the branch ???)

This is solely a matter of preference and agreement.

Any preparatory release work (change debug define from true to false, clear the cache, compress css, js)

either keep two branches (for debug and for release, they are often called develop and release / rc / master), or more correctly, make a deployment script — a special script that will check, package / process and where flood.

4) I understand correctly that git should not be on the combat server?

git may be, but to use it for a lazy deployment (that is, a simple pull) is not worth it. Many people make this mistake and then have something to do :)

5) git pull --rebase or git pull to use just to update the changes

Unfortunately, Linus did not resolve this issue and this leads to constant wars of religion. My personal opinion is that the team that is shorter is the right one :)

  • Many thanks for the detailed answer. Half of the questions have disappeared. A couple left : - GroZa
  • 1) "make a deployment script - a special script," - but do not tell me if you are ready-made solutions for deployment / compression? I understand the deployment script should run automatically after a commit to the release branch? - GroZa
  • 2) What is bad git pull on the combat server? the fact is that before my arrival there it was used that way. I want to argue on Monday. - GroZa
  • It is unlikely that such a universal script can exist - each site is little by little unique. But in general, it all comes down to copying files and thrusting the correct configs. I would not recommend running such a script after each commit to release. Few things will be closed there and when. But on some test server it might be a good idea. Why do not you need to keep a git on the sale? well, except that it requires extra space, there have been many "epic fail" with this in the world. This is how it can be with svn . Exactly the same can happen in git - KoVadim