J
J
JarryRoxwell2019-02-14 03:24:34
git
JarryRoxwell, 2019-02-14 03:24:34

How to organize work in a team on GitHub?

Hello. I started learning git and it's not entirely clear how teamwork is organized.
For example. Team of two.
There is an index.php file, and they both edit it, one wrote echo "a"; and the other print(“a”), then commit and upload to the remote repository. But only one person will load, the second will get an error when trying to git push.
How are such mistakes avoided? And who should control this process?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Nizhny Novgorod, 2019-02-14
@JarryRoxwell

At one time, when I started working, they gave me such a cheat sheet.
Workflow - you create a separate branch, make changes there, and then merge it into the main branch.
git checkout master
git pull
git checkout -b
git add . add everything to your local turnip
commit git commit -m “some commit message”…
push your branch to the turnip git push origin your branch name the
name can be checked in the IDE (bottom right) or via git status
git checkout master
git pull origin master
git merge your_branch_name
git push origin master

L
lukoie, 2019-02-14
@lukoie

for success you need only two steps
0) search on the toaster 1
) profit

A
Anatoly Medvedev, 2019-02-14
@balamyt92

First, learn how to work with branches.
1) don’t work in the same branch and don’t work in the main branch
2) when you make a feature/edit/fix a bug, make a branch from the main branch for it
3) merge everything through a pull request into the main branch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question