Answer the question
In order to leave comments, you need to log in
Git - please explain why you came up with add? Why it was impossible to do immediately commit (Without add)?
I'm just starting to learn Git, so I don't get it. Tell.
Answer the question
In order to leave comments, you need to log in
because you won't always want to add all the files that have changed. Often you need to add some.
Example: you were viewing some file, accidentally put a space there. Git status showed 4 changed files, although you are sure of only 3. Then you add three files and freely commit them, and then deal with the fourth.
Especially vital for hotfixes, when there is no time to deal with something, you just need to upload one file with a fix.
Why not just read the documentation? It is even in Russian: https://git-scm.com/book/ru/v1/%D0%92%D0%B2%D0%B5%... . Immediately many questions will disappear. After all, such questions are often from ignorance of history and misunderstanding of the technology itself.
Why not? Can. git commit -a.
Let's say you fixed some bug in the code and added a new icon at the same time. These changes you want to spread across different commits for clarity. To do this, you can separately add the necessary files for different commits.
A commit is a record of changes to a repository, i.e. an action that changes the history of a project. And add is adding a file (or part of it) under version control once, to include a file or part of it for writing in the next commit two (this command has several purposes, it is universal). The repository can contain both controlled files (tracked) and untracked (any garbage for example). For the convenience of recording commits, you can use the command $ git commit -am "имя коммита"
(where the "a" flag means adding all previously tracked files to the commit, and the "m" flag means that the commit name is specified in the input line, and not in an external editor, such as vim ) dangled underfoot and did not pop up in tooltips for untracked files; it is listed in the file.gitignore
Why specify in the address field who to send the email to?
Let after writing the letter go to everyone who is in the address book ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question