Отчет по лабораторной работе № 2 "Система контроля версий Git"

Выполнила: Рыбакова С.А.
Группа:   А-02-24
Проверил: 

Примечание: работа выполнялась на MacOS.

1. Создала на рабочем столе каталог lab02  и создала каталоги Алисы и Боба, создала каталог "project",
изучила команду "cd" в процессе:	

svetlanarybakova@MacBook-Pro-Svetlana ~ % cd desktop
svetlanarybakova@MacBook-Pro-Svetlana desktop % cd lab02
svetlanarybakova@MacBook-Pro-Svetlana lab02 % cd alice
svetlanarybakova@MacBook-Pro-Svetlana alice % cd ..
svetlanarybakova@MacBook-Pro-Svetlana lab02 % cd alice
svetlanarybakova@MacBook-Pro-Svetlana alice % cd project
svetlanarybakova@MacBook-Pro-Svetlana project % cd ..
svetlanarybakova@MacBook-Pro-Svetlana alice % cd project

2. Инициализировала репозитарий:

svetlanarybakova@MacBook-Pro-Svetlana project % git init

Initialized empty Git repository in /Users/svetlanarybakova/Desktop/lab02/alice/project/.git/

3. Переименовала ветку в "main":
svetlanarybakova@MacBook-Pro-Svetlana project % git branch -m main

4.Настроила имя пользователя и email:
svetlanarybakova@MacBook-Pro-Svetlana project % git config user.name 'Alice (RybakovaSA)'                                 
git config user.email 'RybakovaSA@mpei.ru'

5.Проверила статус репозитория:

svetlanarybakova@MacBook-Pro-Svetlana project % git status

On branch main

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	DerivedData/
	main.cpp
	project.xcodeproj/

nothing added to commit but untracked files present (use "git add" to track)
svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp

6.Добавила файлы main.cpp в индекс и закоммитила их:

svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code: заготовка программы'

[main (root-commit) 0fcaee1] code: заготовка программы
 1 file changed, 14 insertions(+)
 create mode 100644 main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project %  git add project.xcodeproj
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'build: добавлен файл проекта'

[main 8388df1] build: добавлен файл проекта
 7 files changed, 326 insertions(+)
 create mode 100644 project.xcodeproj/project.pbxproj
 create mode 100644 project.xcodeproj/project.xcworkspace/contents.xcworkspacedata
 create mode 100644 project.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
 create mode 100644 project.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
 create mode 100644 project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate
 create mode 100644 project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/WorkspaceSettings.xcsettings
 create mode 100644 project.xcodeproj/xcuserdata/svetlanarybakova.xcuserdatad/xcschemes/xcschememanagement.plist

svetlanarybakova@MacBook-Pro-Svetlana project % git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   main.cpp
	modified:   project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	DerivedData/

no changes added to commit (use "git add" and/or "git commit -a")
svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp

7.Добавила файлы main.cpp в индекс и закоммитила их:
git commit -m "code: вывод А и В"        

[main a4ecbfa] code: вывод А и В
 1 file changed, 5 insertions(+), 10 deletions(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git add -u
git commit -m "code: сумма А и В"

[main 551b8a3] code: сумма А и В
 2 files changed, 1 insertion(+), 1 deletion(-)

svetlanarybakova@MacBook-Pro-Svetlana project % git commit -a -m "code: разность А и В"
[main 73b73f1] code: разность А и В
 2 files changed, 2 insertions(+), 1 deletion(-)

8. Создание и заполнение .gitignore

svetlanarybakova@MacBook-Pro-Svetlana project % touch .gitignore
svetlanarybakova@MacBook-Pro-Svetlana project % nano .gitignore
svetlanarybakova@MacBook-Pro-Svetlana project % git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	.gitignore

no changes added to commit (use "git add" and/or "git commit -a")

 9. Добавление нового файла в .gitignore

svetlanarybakova@MacBook-Pro-Svetlana project % echo "project.xcodeproj/project.xcworkspace/xcuserdata/" >> .gitignore
git rm --cached -r project.xcodeproj/project.xcworkspace/xcuserdata/
git commit -m "Ignore Xcode user data"

rm 'project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate'
rm 'project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/WorkspaceSettings.xcsettings'
[main b4c965e] Ignore Xcode user data
 2 files changed, 16 deletions(-)
 delete mode 100644 project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate
 delete mode 100644 project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/WorkspaceSettings.xcsettings

svetlanarybakova@MacBook-Pro-Svetlana project % nano .gitignore

10. Коммит .gitignore

svetlanarybakova@MacBook-Pro-Svetlana project % git add .gitignore
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m "git: создан .gitignore"
[main 0f5bfc9] git: создан .gitignore
 1 file changed, 20 insertions(+)
 create mode 100644 .gitignore

11. git log показывает текст с прокруткой
    git log --stat показывает файлы, измененные в коммитах.

svetlanarybakova@MacBook-Pro-Svetlana project % git log
commit 0f5bfc913ce16d9ae548515a1456a456975b2c10 (HEAD -> main)
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:43:23 2025 +0300

    git: создан .gitignore

commit b4c965edba5eba8235e0330fd840c79e2728320b
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:41:00 2025 +0300

    Ignore Xcode user data

commit 73b73f1d3f629249aa43ab73a19609d643858457
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:37:18 2025 +0300

    code: разность А и В

commit 551b8a3a305f96af27fd2fd095c5e03e005280d2
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:35:03 2025 +0300

    code: сумма А и В
svetlanarybakova@MacBook-Pro-Svetlana project % git log --stat
commit 0f5bfc913ce16d9ae548515a1456a456975b2c10 (HEAD -> main)
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:43:23 2025 +0300

    git: создан .gitignore

 .gitignore | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(Этот вывод означает:
	•	Был изменен один файл .gitignore.
	•	В файл добавлено 20 новых строк (нет удаленных строк).
	•	Статистика изменений отображается в виде количества добавленных (+) и удаленных (-) строк.)

commit b4c965edba5eba8235e0330fd840c79e2728320b
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:41:00 2025 +0300

    Ignore Xcode user data

 .../UserInterfaceState.xcuserstate                      | Bin 13879 -> 0 bytes
 .../WorkspaceSettings.xcsettings                        |  16 ----------------
 2 files changed, 16 deletions(-)

commit 73b73f1d3f629249aa43ab73a19609d643858457
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:37:18 2025 +0300

12. git log --oneline --decorate показывает коммиты компактно, а также показывает ссылки, концы веток и тэги.

svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --decorate
0f5bfc9 (HEAD -> main) git: создан .gitignore
b4c965e Ignore Xcode user data
73b73f1 code: разность А и В
551b8a3 code: сумма А и В
a4ecbfa code: вывод А и В
8388df1 build: добавлен файл проекта
0fcaee1 code: заготовка программы

13. git log --oneline --decorate --all --graph делает то же для всех веток, причем коммиты отображаются в терминале в виде дерева

svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --decorate --all --graph
* 0f5bfc9 (HEAD -> main) git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

svetlanarybakova@MacBook-Pro-Svetlana project % git log --grep "build:"
commit 8388df181b85cf2b81b9e82ea2d9653a01ea4464
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:28:16 2025 +0300

    build: добавлен файл проекта

svetlanarybakova@MacBook-Pro-Svetlana project % git log -- project.xcodeproj
commit b4c965edba5eba8235e0330fd840c79e2728320b
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:41:00 2025 +0300

    Ignore Xcode user data

commit 73b73f1d3f629249aa43ab73a19609d643858457
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:37:18 2025 +0300

    code: разность А и В

commit 551b8a3a305f96af27fd2fd095c5e03e005280d2
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:35:03 2025 +0300

    code: сумма А и В

commit 8388df181b85cf2b81b9e82ea2d9653a01ea4464
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:28:16 2025 +0300

    build: добавлен файл проекта

14.предпоследний коммит

svetlanarybakova@MacBook-Pro-Svetlana project % git show HEAD~1
commit b4c965edba5eba8235e0330fd840c79e2728320b
Author: Alice (RybakovaSA) <RybakovaSA@mpei.ru>
Date:   Sun Mar 30 20:41:00 2025 +0300

    Ignore Xcode user data

diff --git a/project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate b/project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index 4f647e4..0000000
Binary files a/project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/WorkspaceSettings.xcsettings b/project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/WorkspaceSettings.xcsettings
deleted file mode 100644
index b4f210d..0000000
--- a/project.xcodeproj/project.xcworkspace/xcuserdata/svetlanarybakova.xcuserdatad/WorkspaceSettings.xcsettings
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

15.Просмотр изменений

svetlanarybakova@MacBook-Pro-Svetlana project % git diff

diff --git a/main.cpp b/main.cpp
index f5ce34a..abbaa76 100644
--- a/main.cpp
+++ b/main.cpp
@@ -5,6 +5,7 @@ int main() {
     int a, b;
     cin >> a >> b;
     cout << "A + B = " << a + b << '\n'
-         << "A - B = " << a - b << '\n';
+         << "A - B = " << a - b << '\n'
+         << "A * B = " << a * b << '\n';
     return 0;
 }
(Разбор строк патча:
diff --git a/main.cpp b/main.cpp — показывает, что файл main.cpp изменен.
index f5ce34a..abbaa76 100644 — индексы изменений и права доступа к файлу.
--- a/main.cpp — старая версия файла.
+++ b/main.cpp — новая версия файла.
@@ -5,6 +5,7 @@ — контекст изменений:
-5,6 означает, что старый код затрагивает строки 5-6.
+5,7 указывает, что новый код содержит строки 5-7.
- перед строкой показывает удаление кода.
+ перед строкой показывает добавленный код.)
svetlanarybakova@MacBook-Pro-Svetlana project % git diff 0fcaee1 73b73f1

diff --git a/main.cpp b/main.cpp
index 346e589..f5ce34a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,14 +1,10 @@
-//
-//  main.cpp
-//  project
-//
-//  Created by Светлана Рыбакова on 30.03.2025.
-//
-
 #include <iostream>
 
-int main(int argc, const char * argv[]) {
-    // insert code here...
-    std::cout << "Hello, World!\n";
+int main() {
+    cout << "Enter A and B: ";
+    int a, b;
+    cin >> a >> b;
+    cout << "A + B = " << a + b << '\n'
+         << "A - B = " << a - b << '\n';

16. Коммит main.cpp, произведение А и В

svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code: произведение А и В'

[main 94c1886] code: произведение А и В
 1 file changed, 2 insertions(+), 1 deletion(-)

17.Откат изменений

svetlanarybakova@MacBook-Pro-Svetlana project % git reset --hard HEAD~1

HEAD is now at 0f5bfc9 git: создан .gitignore

18. Создание «ключей» SSH

svetlanarybakova@MacBook-Pro-Svetlana project % ssh-keygen

Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/svetlanarybakova/.ssh/id_ed25519): 
/Users/svetlanarybakova/.ssh/id_ed25519 already exists.
Overwrite (y/n)? yes
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/svetlanarybakova/.ssh/id_ed25519
Your public key has been saved in /Users/svetlanarybakova/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:D4kljcUds+FXpJjgwo4r48xVV5WDJEUcLR0OajWi9uw svetlanarybakova@MacBook-Pro-Svetlana.local
The key's randomart image is:
+--[ED25519 256]--+
|       .=*%*o+o  |
|     . *.B=@=o   |
|      B * *.+.   |
|     + O o .     |
|    . + S        |
|     o o o       |
|  o o   E .      |
| + +             |
|  +              |
+----[SHA256]-----+
svetlanarybakova@MacBook-Pro-Svetlana project % eval $(ssh-agent -s)

Agent pid 1462

svetlanarybakova@MacBook-Pro-Svetlana project % ssh-add

Enter passphrase for /Users/svetlanarybakova/.ssh/id_ed25519: 
Identity added: /Users/svetlanarybakova/.ssh/id_ed25519 (svetlanarybakova@MacBook-Pro-Svetlana.local)
svetlanarybakova@MacBook-Pro-Svetlana project % cat ~/.ssh/id_ed25519.pub

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDiE8nbWPjtxSECTnlj3ZOOpGBFtFEm3pkV7XsmZssjZ svetlanarybakova@MacBook-Pro-Svetlana.local

Enter passphrase for /Users/svetlanarybakova/.ssh/id_ed25519: 
Identity added: /Users/svetlanarybakova/.ssh/id_ed25519 (svetlanarybakova@MacBook-Pro-Svetlana.local)

19.Отправка проекта на сервер

svetlanarybakova@MacBook-Pro-Svetlana project % git remote add origin git@uit.mpei.ru:RybakovaSA/cs-lab02.git
git push -u origin main
Enumerating objects: 46, done.
Counting objects: 100% (46/46), done.
Delta compression using up to 11 threads
Compressing objects: 100% (44/44), done.
Writing objects: 100% (46/46), 22.46 KiB | 7.49 MiB/s, done.
Total 46 (delta 8), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:RybakovaSA/cs-lab02.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

svetlanarybakova@MacBook-Pro-Svetlana project % git remote -v
origin	git@uit.mpei.ru:RybakovaSA/cs-lab02.git (fetch)
origin	git@uit.mpei.ru:RybakovaSA/cs-lab02.git (push)

20. Боб присоединился 

svetlanarybakova@MacBook-Pro-Svetlana ~ % cd desktop
svetlanarybakova@MacBook-Pro-Svetlana desktop % cd lab02
svetlanarybakova@MacBook-Pro-Svetlana lab02 % cd bob
svetlanarybakova@MacBook-Pro-Svetlana bob % git clone git@uit.mpei.ru:RybakovaSA/cs-lab02.git project

Cloning into 'project'...
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
remote: Enumerating objects: 46, done.
remote: Counting objects: 100% (46/46), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 46 (delta 8), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (46/46), 22.46 KiB | 139.00 KiB/s, done.
Resolving deltas: 100% (8/8), done.
svetlanarybakova@MacBook-Pro-Svetlana bob % cd project

svetlanarybakova@MacBook-Pro-Svetlana project % git config user.name 'Bob (RybakovaSA)'  
git config user.email 'bob@example.com'

svetlanarybakova@MacBook-Pro-Svetlana project % cd ..
svetlanarybakova@MacBook-Pro-Svetlana bob % cd project
svetlanarybakova@MacBook-Pro-Svetlana project % git config user.name 'Bob (RybakovaSA)'
git config user.email 'bob@example.com'

21. Боб. Совместная работа над проектом без конфликтов правок

svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project %  git commit -m 'code: произведение А и В'

[main d221187] code: произведение А и В
 1 file changed, 2 insertions(+), 1 deletion(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --decorate
d221187 (HEAD -> main) code: произведение А и В
0f5bfc9 (origin/main, origin/HEAD) git: создан .gitignore
b4c965e Ignore Xcode user data
73b73f1 code: разность А и В
551b8a3 code: сумма А и В
a4ecbfa code: вывод А и В
8388df1 build: добавлен файл проекта
0fcaee1 code: заготовка программы
svetlanarybakova@MacBook-Pro-Svetlana project % git push

Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 11 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 431 bytes | 431.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:RybakovaSA/cs-lab02.git
   0f5bfc9..d221187  main -> main

22. Обратно к Алисе 

svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --decorate
0f5bfc9 (HEAD -> main, origin/main) git: создан .gitignore
b4c965e Ignore Xcode user data
73b73f1 code: разность А и В
551b8a3 code: сумма А и В
a4ecbfa code: вывод А и В
8388df1 build: добавлен файл проекта
0fcaee1 code: заготовка программы

svetlanarybakova@MacBook-Pro-Svetlana project % git fetch

remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 411 bytes | 137.00 KiB/s, done.
From uit.mpei.ru:RybakovaSA/cs-lab02
   0f5bfc9..d221187  main       -> origin/main
svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --decorate --all --graph

* d221187 (origin/main) code: произведение А и В
* 0f5bfc9 (HEAD -> main) git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

svetlanarybakova@MacBook-Pro-Svetlana project % git pull --ff-only

Updating 0f5bfc9..d221187
Fast-forward
 main.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

23.Алиса. Добавление деления 

svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code: деление А на В' 
[main 30c5603] code: деление А на В
 1 file changed, 1 insertion(+)
svetlanarybakova@MacBook-Pro-Svetlana project % git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 11 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 402 bytes | 402.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:RybakovaSA/cs-lab02.git
   d221187..30c5603  main -> main

24. Боб принял 
svetlanarybakova@MacBook-Pro-Svetlana project % git fetch

Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
svetlanarybakova@MacBook-Pro-Svetlana project %  git fetch
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
svetlanarybakova@MacBook-Pro-Svetlana project % git fetch
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 382 bytes | 127.00 KiB/s, done.
From uit.mpei.ru:RybakovaSA/cs-lab02
   d221187..30c5603  main       -> origin/main
svetlanarybakova@MacBook-Pro-Svetlana project % git pull --ff-only

Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
Updating d221187..30c5603
Fast-forward
 main.cpp | 1 +
 1 file changed, 1 insertion(+)
25. Удалим лишний знак через Алису и сохраним у боба 
svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code: удаление знака'
[main 87fc9e8] code: удаление знака
 1 file changed, 1 insertion(+), 1 deletion(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 11 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 388 bytes | 388.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:RybakovaSA/cs-lab02.git
   30c5603..87fc9e8  main -> main

Боб принимает
 
svetlanarybakova@MacBook-Pro-Svetlana project % git fetch
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 368 bytes | 73.00 KiB/s, done.
From uit.mpei.ru:RybakovaSA/cs-lab02
   30c5603..87fc9e8  main       -> origin/main
svetlanarybakova@MacBook-Pro-Svetlana project % git pull --ff-only
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
Updating 30c5603..87fc9e8
Fast-forward
 main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

26. Алиса добавляет максимум 
svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code: max А и В' 
[main 049d89c] code: max А и В
 1 file changed, 2 insertions(+), 1 deletion(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 11 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 416 bytes | 416.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:RybakovaSA/cs-lab02.git
   87fc9e8..049d89c  main -> main

27. Боб добавляет минимум 

svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code: min А и В'
 
[main 65c1486] code: min А и В
 1 file changed, 2 insertions(+), 1 deletion(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git push
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
To uit.mpei.ru:RybakovaSA/cs-lab02.git
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'uit.mpei.ru:RybakovaSA/cs-lab02.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
svetlanarybakova@MacBook-Pro-Svetlana project % git pull --ff-only

Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 396 bytes | 99.00 KiB/s, done.
From uit.mpei.ru:RybakovaSA/cs-lab02
   87fc9e8..049d89c  main       -> origin/main
fatal: Not possible to fast-forward, aborting.
svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --graph --all

* 65c1486 (HEAD -> main) code: min А и В
| * 049d89c (origin/main, origin/HEAD) code: max А и В
|/  
* 87fc9e8 code: удаление знака
* 30c5603 code: деление А на В
* d221187 code: произведение А и В
* 0f5bfc9 git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

svetlanarybakova@MacBook-Pro-Svetlana project % git rebase origin/main

Auto-merging main.cpp
CONFLICT (content): Merge conflict in main.cpp
error: could not apply 65c1486... code: min А и В
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 65c1486... code: min А и В
svetlanarybakova@MacBook-Pro-Svetlana project % git status

interactive rebase in progress; onto 049d89c
Last command done (1 command done):
   pick 65c1486 code: min А и В
No commands remaining.
You are currently rebasing branch 'main' on '049d89c'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
	both modified:   main.cpp

no changes added to commit (use "git add" and/or "git commit -a")
svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp

svetlanarybakova@MacBook-Pro-Svetlana project % git rebase --continue
[detached HEAD f00b798] code: min А и В
 1 file changed, 2 insertions(+), 1 deletion(-)
Successfully rebased and updated refs/heads/main.
svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --graph --all

* f00b798 (HEAD -> main) code: min А и В
* 049d89c (origin/main, origin/HEAD) code: max А и В
* 87fc9e8 code: удаление знака
* 30c5603 code: деление А на В
* d221187 code: произведение А и В
* 0f5bfc9 git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

svetlanarybakova@MacBook-Pro-Svetlana project % git push 
Enter passphrase for key '/Users/svetlanarybakova/.ssh/id_ed25519': 
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 11 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 394 bytes | 394.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:RybakovaSA/cs-lab02.git
   049d89c..f00b798  main -> main
svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --graph --all 
* f00b798 (HEAD -> main, origin/main, origin/HEAD) code: min А и В
* 049d89c code: max А и В
* 87fc9e8 code: удаление знака
* 30c5603 code: деление А на В
* d221187 code: произведение А и В
* 0f5bfc9 git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

28.Использование веток

svetlanarybakova@MacBook-Pro-Svetlana project % git branch double

svetlanarybakova@MacBook-Pro-Svetlana project % git checkout double

Switched to branch 'double'
svetlanarybakova@MacBook-Pro-Svetlana project % git add main.cpp
svetlanarybakova@MacBook-Pro-Svetlana project % git commit -m 'code:  изменение типа на double' 
[double 9d5c69f] code:  изменение типа на double
 1 file changed, 1 insertion(+), 1 deletion(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git checkout main

Switched to branch 'main'
Your branch is up to date with 'origin/main'.
svetlanarybakova@MacBook-Pro-Svetlana project % git status
git log --oneline --graph --all

On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
* 9d5c69f (double) code:  изменение типа на double
* 049d89c (HEAD -> main, origin/main) code: max А и В
* 87fc9e8 code: удаление знака
* 30c5603 code: деление А на В
* d221187 code: произведение А и В
* 0f5bfc9 git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

svetlanarybakova@MacBook-Pro-Svetlana project % git pull --ff-only

remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 374 bytes | 124.00 KiB/s, done.
From uit.mpei.ru:RybakovaSA/cs-lab02
   049d89c..f00b798  main       -> origin/main
Updating 049d89c..f00b798
Fast-forward
 main.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --graph --all
* 9d5c69f (double) code:  изменение типа на double
| * f00b798 (HEAD -> main, origin/main) code: min А и В
|/  
* 049d89c code: max А и В
* 87fc9e8 code: удаление знака
* 30c5603 code: деление А на В
* d221187 code: произведение А и В
* 0f5bfc9 git: создан .gitignore
* b4c965e Ignore Xcode user data
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы

29. Слияние веток 

svetlanarybakova@MacBook-Pro-Svetlana project % git merge double

Auto-merging main.cpp
Merge made by the 'ort' strategy.
 main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
svetlanarybakova@MacBook-Pro-Svetlana project % git log --oneline --graph --all

*   2d90237 (HEAD -> main) Merge branch 'double' to main
|\  
| * 9d5c69f (double) code:  изменение типа на double
* | f00b798 (origin/main) code: min А и В
|/  
* 049d89c code: max А и В
* 87fc9e8 code: удаление знака
* 30c5603 code: деление А на В
* d221187 code: произведение А и В
* 0f5bfc9 git: создан .gitignore
* 73b73f1 code: разность А и В
* 551b8a3 code: сумма А и В
* a4ecbfa code: вывод А и В
* 8388df1 build: добавлен файл проекта
* 0fcaee1 code: заготовка программы