A
A
alaskafx2021-11-05 17:18:02
git
alaskafx, 2021-11-05 17:18:02

Git and two questions about work?

Imagine that two developers are working on the same file, and one of them pushes it to the repository...
What will happen to the second developer's file, who did a git pull, seeing that git tells him that there were changes?
Will Git overwrite the file or add changes from the repository to the file ?

When I made a commit for the very first time, my command was: git commit 'текст', but all subsequent commits began to tell me something like Everything up-to-date.. After a short googling, I found another way to make commits: git commit -m 'текст', the essence was in the flag -m, the meaning of which is - I and did not understand.
What is this flag -m?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DollyPapper, 2021-11-05
@alaskafx

1) he will offer to first pull the branch to himself, if there are conflicts, he will offer to resolve them, then merge, after that you can push again
2) it means message. That is a message to the commit

S
SagePtr, 2021-11-05
@SagePtr

To prevent this from happening, it is better to work in separate branches, then, upon completion, merge them into master and resolve conflicts at this stage.

A
Alexander Karabanov, 2021-11-05
@karabanov

Git Basics

F
Frontend developer, 2021-11-05
@markak

Better read chapter 2
https://git-scm.com/book/en/v2/%D0%9E%D1%81%D0%BD%...


There is another way - you can type your commit comment on the command line along with the commit command by specifying it after the -m parameter, as in the following example:
$ git commit -m "Story 182: fix benchmarks for speed"
[master 463dc4f] Story 182: fix benchmarks for speed
 2 files changed, 2 insertions(+)
 create mode 100644 README

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question