Answer the question
In order to leave comments, you need to log in
How to use GIT correctly?
Hello, I’m just starting to write websites, we are the 3rd person who wants to write a simple business card website (in order to learn how to do everything right)
To do this, we bought a VPS with ubuntu. put apache, php, mysql there
We have only basic knowledge of php, html, css, js
Never worked with git
I want to immediately start doing it right
Actually, I understand correctly we need:
1) Everyone on their computer (we have Windows) puts the same the same as on VPS - php, mysql, apache
Here everyone will have a test version of the site
2) Everyone puts git on his computer
3) ???
4)???
Is it necessary to install git on a VPS Server?
Does GIT take into account changes in MySql? If someone adds a new table
Do I need github? Or other similar sites
How do I organize all this?
I didn’t really find examples of use from scratch on combat projects on the Internet.
Usually they just install git and show how it works on txt files.
That is, you can have some step-by-step instructions, like
put each one on your own ...
on github you will have it. ...
And in 2 words describe how we can jointly organize the work
Answer the question
In order to leave comments, you need to log in
Github Flow in 5 minutes.
1. Created a branch for the feature/fix
2. Made several commits to the branch
3. Sent a pull request
4. Discussed the pull request with colleagues and made changes if necessary
5. Run the branch through tests.
6. Poured into master
7. Rolled out master to production
If the feature branch does not merge for a long time and starts to diverge from the master branch, then merge master into the feature branch and continue.
If someone from the team wants to test a new feature with their hands, they can do
AND test it with their hands locally on their dev machine.
Update: If sql base, then write migrations. You can see in any framework what it is and how to use it. After each git pull, we try to roll the migrations through the console (you can write a hook for the git) and if there are new migrations, they will be applied to the local database. If the nosql database is of type mongo, then nothing is needed, they are schemaless.
On production, we pull the code from the git into a separate directory. We apply migrations to the database, then switch the symlink from the directory with the old version of the project to the directory with the new version of the project. If migrations break the old version of the project, then you must first turn off the project so that users do not get any uncaught exceptions. This is in short, for all this you need to pick up a ready-made deployment tool for yourself, which will automatically do all this.
I strongly advise you to read https://git-scm.com/book/en/v2
In short (I can make mistakes in some points)
1) Everyone puts what is convenient for him (denwer, xampp, openserver (I recommend openserver under Windows))
2) Put each git
3) You fight on bitbucket. You join the beatbucket, create a team, while the three of you will be there for free. You create an empty project there
4) You create a project on the VPS (it usually already has a git on it)
5) you do init git on the VPS and push it to the project on the bitbucket
6) You merge files from the server to each and everyone makes a clone of the turnip from the git 7) Work
, make commits, write to bitbucket.
8) Then shoot from bitbucket to VPS
Is it necessary to install git on a VPS Server?
Since the purpose of learning is:
1. disconnect from the VPS;
2. set up the environment through VM - docker (it's better to learn right away);
3. commit the project structure with dockerfile (dockercompose) either in bitbucket or github;
4. comrades fork the project and make pull requests;
5. if the site is made, and you need to show it to someone, then only buy a VPS.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question