I
I
itexams2017-01-11 18:53:44
git
itexams, 2017-01-11 18:53:44

How to connect github to a real project?

Recently I decided to finally transfer my project to github, started to study the issue and finally got completely confused.
As a result, now, in principle, I no longer quite understand the purpose of github.
The essence of the question is as follows, for example, I have a web project / startup. And I actively did it - I did it, bought a domain, hosting - I posted everything there and the result can be viewed at www.startup.ru - conditionally.
Now, for example, I want to connect more friends and start working on the project more seriously using a distributed version system.
And now I don’t understand at all whether it’s possible to somehow use github here to work on the project.
That is, the goal is for the files of my site on the hosting to become the master branch, and for me and all my friends to be able to work with their branches as they like, and only by making a merge with the master branch - the data on the site is updated.
But github is not intended for this, is it? for me, it is not tied directly to my site - these are just files that are separate - and how to start a project from github is not clear? Where, then, can you watch your changes and test developments if this does not work with github? how does it work with github?
If it’s different, then please explain how to properly put together:
- a ready-made site with a hosted domain
- IDE PhpShtorm
- the ability to use git - so that the master branch is tied directly to the product - site
and what about github? under what conditions can it be connected here?
Thank you. )

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Saboteur, 2017-01-11
@itexams

You can not upload a repository to the site.
github should be used to store the repository with all versions.
That is, the master is not a site. The master and other branches are inside the repository, and the files are uploaded to the site during the deployment process, without any .git and other service files, otherwise this is a vulnerability.

T
TyzhSysAdmin, 2017-01-11
@POS_troi

Git deploy

S
Sergey, 2017-01-11
@gangstarcj

github is just a place to store information from git.
Create an empty project (repository) there. Create a git clone of this project on the hosting, add files and push to the github server.
Next, your team does a git clone of your repository and does the work they need, also pushes to the server. When you need to, you pull from the github server to the hosting site.
Well, that's it in a nutshell, and that should be enough for the first time.
There are some guitar lessons on YouTube, I advise you to watch them

M
malbaron, 2017-01-11
@malbaron

If we are talking about open development, then it’s quite github.
If we are talking about closed development with a permanent team, then something like gitlab is better, it allows you to organize work on the project more tightly.
Github etc. are just repositories.
How to connect to your project - you decide in each project separately.
It’s just that at the next commit, a hook in Gitlab is triggered, which pulls a utility that sucks files into the Docker image. This image is run on a test server. If the tests pass successfully, then the image is launched on the production server, requests are routed to the new server, and the old image on the production server is disabled.
How to do it - also read here:
https://flynn.io/docs/basics
or here:
https://deis.com/workflow/how-it-works/
Git, Github, Gitlab, Bitbucket и т.п здесь не более чем хранилище исходных файлов.
Возможно, умное хранилище, но не более того.
Само по себе оно ваш сайт не запустит.
Исключение - статические сайты или сайты где вся логика во фронтенде.
См. github pages и т.п.

I
itexams, 2017-01-11
@itexams Автор вопроса

а есть ли вообще какой-то бест практис о том, как это должно работать? имеется ввиду разработка реального проекта вместе с гитхаб?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question