Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
711 строки
27 KiB
Plaintext
711 строки
27 KiB
Plaintext
Отчет по лабораторной работе № 2 "Система контроля версий Git"
|
|
|
|
Выполнил: Кривов Д. А.
|
|
Группа: А-01-24
|
|
Проверил: Кривов Д. А.
|
|
|
|
Примечание: работа выполнялась на Windows.
|
|
|
|
1. Создал на рабочем столе каталог lab02 и запустил в нем Git Bash, приглашение:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
|
|
2. Просмотрел файлы в рабочем каталоге можно командой "ls" --- пусто:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
$ ls
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
$
|
|
|
|
3. Создал каталоги Алисы и Боба, создал каталог "project",
|
|
изучил команду "cd" в процессе:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
$ mkdir alice
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
$ mkdir bob
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
$ cd bob
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob
|
|
$ cd ..
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02
|
|
$ cd alice
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice
|
|
$ mkdir project
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice
|
|
$ ls
|
|
project
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice
|
|
$ cd project
|
|
|
|
4. Инициализировал репозитарий:
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project
|
|
$ git init
|
|
Initialized empty Git repository in C:/Users/krivo/Desktop/lab02/alice/project/.git/
|
|
|
|
5. Поменял имя ветки:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (master)
|
|
$ git branch -m main
|
|
|
|
6. Посмотрел на скрытый каталог .git:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ ls -A
|
|
.git/ bin/ main.cpp obj/ project.cbp
|
|
|
|
7. Добавил локальные настройки репозитария:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git config user.name 'Alice (KrivovDA)'
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git config user.email 'krivovda@mail.com'
|
|
|
|
8. Просмотрил состояние рабочей копии:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git status
|
|
On branch main
|
|
|
|
No commits yet
|
|
|
|
Untracked files:
|
|
(use "git add <file>..." to include in what will be committed)
|
|
bin/
|
|
main.cpp
|
|
obj/
|
|
project.cbp
|
|
|
|
nothing added to commit but untracked files present (use "git add" to track)
|
|
|
|
9. Добавил файл main.cpp в набор изменений, который войдет в очередной коммит:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git status
|
|
On branch main
|
|
|
|
No commits yet
|
|
|
|
Changes to be committed:
|
|
(use "git rm --cached <file>..." to unstage)
|
|
new file: main.cpp
|
|
|
|
Untracked files:
|
|
(use "git add <file>..." to include in what will be committed)
|
|
bin/
|
|
obj/
|
|
project.cbp
|
|
|
|
10. Выполнил коммит с файлом main.cpp:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -m 'code: заготовка программы'
|
|
[main (root-commit) fe6b1fb] code: заготовка программы~
|
|
1 file changed, 9 insertions(+)
|
|
create mode 100644 main.cpp
|
|
|
|
11. Добавил файл project.cbp в набор изменений, который войдет в очередной коммит:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git add project.cbp
|
|
warning: in the working copy of 'project.cbp', LF will be replaced by CRLF the next time Git touches it
|
|
|
|
12.Выполнил коммит с файлом project.cbp:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -m 'build: добавлен файл проекта'
|
|
[main cc901d0] build: добавлен файл проекта
|
|
1 file changed, 40 insertions(+)
|
|
create mode 100644 project.cbp
|
|
|
|
13. Заменил тело функции main():
|
|
cout << "Enter A and B: ";
|
|
int a, b;
|
|
cin >> a >> b;
|
|
|
|
14. Просмотрел состояние репозитария:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ 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
|
|
|
|
Untracked files:
|
|
(use "git add <file>..." to include in what will be committed)
|
|
bin/
|
|
obj/
|
|
project.depend
|
|
|
|
no changes added to commit (use "git add" and/or "git commit -a")
|
|
|
|
|
|
15. Выполнил коммит изменённых файлов:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "изменённое тело кода"
|
|
[main ef032cd] изменённое тело кода
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
16. Посмотрел состояние репозитария:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ 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
|
|
|
|
Untracked files:
|
|
(use "git add <file>..." to include in what will be committed)
|
|
bin/
|
|
obj/
|
|
project.depend
|
|
|
|
no changes added to commit (use "git add" and/or "git commit -a")
|
|
|
|
17. Выполнил коммит изменённых файлов:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "добавление вывода суммы и разности"
|
|
[main 9f3751e] добавление вывода суммы и разности
|
|
1 file changed, 2 insertions(+)
|
|
|
|
18. Добавил игнорирование файлов:
|
|
/bin
|
|
/obj
|
|
/project.depend
|
|
|
|
19. Посмотрел состояние репозитария:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git status
|
|
On branch main
|
|
Changes to be committed:
|
|
(use "git restore --staged <file>..." to unstage)
|
|
|
|
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: .gitignore
|
|
|
|
20. Добавил файл .gitignore в набор изменений, который войдет в очередной коммит:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git add .gitignore
|
|
|
|
21. Выполнил коммит изменённых файлов:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "добавление игнорирования файлов"
|
|
[main fcd0a28] добавление игнорирования файлов
|
|
1 file changed, 3 insertions(+)
|
|
create mode 100644 .gitignore
|
|
|
|
22. Открыл журнал репозитария:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git log
|
|
commit fcd0a280a628598f9b613fbb58bd78516062b535 (HEAD -> main)
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 12:41:28 2025 +0300
|
|
|
|
добавление игнорирования файлов
|
|
|
|
commit 9f3751e35a7db34789d2295007e7b175d719f65f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 12:28:02 2025 +0300
|
|
|
|
добавление вывода суммы и разности
|
|
|
|
commit ef032cd1481985041c50e38988b57e1c91a545ee
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:55:06 2025 +0300
|
|
|
|
изменённое тело кода
|
|
|
|
commit cc901d01145c9bf3c624b68695228004b18da61f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:40:43 2025 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
commit fe6b1fb1210428aeb4c50f5223f27e2ee35f2fc4
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:30:14 2025 +0300
|
|
|
|
code: заготовка программы~
|
|
|
|
23. Посмотрел файлы, изменённые в коммитах:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --stat
|
|
commit fcd0a280a628598f9b613fbb58bd78516062b535 (HEAD -> main) // Хэш коммита
|
|
Author: Alice (KrivovDA) <krivovda@mail.com> // Создатель коммита
|
|
Date: Sun Apr 6 12:41:28 2025 +0300 // Дата создания коммита
|
|
|
|
добавление игнорирования файлов // тема коммита
|
|
|
|
.gitignore | 3 +++ // Файл | добавление строк
|
|
1 file changed, 3 insertions(+) // Изменение 1 файла, 3 вставки
|
|
|
|
commit 9f3751e35a7db34789d2295007e7b175d719f65f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 12:28:02 2025 +0300
|
|
|
|
добавление вывода суммы и разности
|
|
|
|
main.cpp | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
commit ef032cd1481985041c50e38988b57e1c91a545ee
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:55:06 2025 +0300
|
|
|
|
изменённое тело кода
|
|
|
|
main.cpp | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
commit cc901d01145c9bf3c624b68695228004b18da61f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:40:43 2025 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
project.cbp | 40 ++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 40 insertions(+)
|
|
|
|
commit fe6b1fb1210428aeb4c50f5223f27e2ee35f2fc4
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:30:14 2025 +0300
|
|
|
|
code: заготовка программы~
|
|
|
|
main.cpp | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
24. Нашёл коммиты по теме build:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --grep "build:"
|
|
commit cc901d01145c9bf3c624b68695228004b18da61f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:40:43 2025 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
|
|
25. Нашёл коммиты затрагивающие project.cbp:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git log -- project.cbp
|
|
commit cc901d01145c9bf3c624b68695228004b18da61f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 11:40:43 2025 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
26. Просмотрел предпоследний коммит по отступу:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git show HEAD~1
|
|
commit 9f3751e35a7db34789d2295007e7b175d719f65f
|
|
Author: Alice (KrivovDA) <krivovda@mail.com>
|
|
Date: Sun Apr 6 12:28:02 2025 +0300
|
|
|
|
добавление вывода суммы и разности
|
|
|
|
diff --git a/main.cpp b/main.cpp
|
|
index eac5055..65442c3 100644
|
|
--- a/main.cpp
|
|
+++ b/main.cpp
|
|
@@ -7,4 +7,6 @@ int main()
|
|
cout << "Enter A and B: ";
|
|
int a, b;
|
|
cin >> a >> b;
|
|
+ cout << "A + B = " << a + b << '\n'
|
|
+ << "A - B = " << a - b << '\n';
|
|
}
|
|
|
|
27. Добавил вывод произведения и посмотрел изменения в рабочей копии:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git diff
|
|
diff --git a/main.cpp b/main.cpp
|
|
index 65442c3..56f78ae 100644
|
|
--- a/main.cpp
|
|
+++ b/main.cpp
|
|
@@ -8,5 +8,6 @@ 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' ; // Добавление строки
|
|
}
|
|
|
|
28. Посмотрел разницу между самым первым коммитом и коммитом, добавляющим вывод разности:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git diff HEAD~4 HEAD~1
|
|
diff --git a/main.cpp b/main.cpp
|
|
index b4392ec..65442c3 100644
|
|
--- a/main.cpp
|
|
+++ b/main.cpp
|
|
@@ -4,6 +4,9 @@ using namespace std;
|
|
|
|
int main()
|
|
{
|
|
- cout << "Hello world!" << endl;
|
|
- return 0;
|
|
+ cout << "Enter A and B: ";
|
|
+ int a, b;
|
|
+ cin >> a >> b;
|
|
+ cout << "A + B = " << a + b << '\n'
|
|
+ << "A - B = " << a - b << '\n';
|
|
}
|
|
diff --git a/project.cbp b/project.cbp
|
|
new file mode 100644
|
|
index 0000000..99bb702
|
|
--- /dev/null
|
|
+++ b/project.cbp
|
|
@@ -0,0 +1,40 @@
|
|
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
|
+<CodeBlocks_project_file>
|
|
+ <FileVersion major="1" minor="6" />
|
|
+ <Project>
|
|
+ <Option title="project" />
|
|
+ <Option pch_mode="2" />
|
|
+ <Option compiler="gcc" />
|
|
+ <Build>
|
|
+ <Target title="Debug">
|
|
+ <Option output="bin/Debug/project" prefix_auto="1" extension
|
|
_auto="1" />
|
|
+ <Option object_output="obj/Debug/" />
|
|
+ <Option type="1" />
|
|
+ <Option compiler="gcc" />
|
|
+ <Compiler>
|
|
+ <Add option="-g" />
|
|
+ </Compiler>
|
|
+ </Target>
|
|
+ <Target title="Release">
|
|
+ <Option output="bin/Release/project" prefix_auto="1" extensi
|
|
on_auto="1" />
|
|
+ <Option object_output="obj/Release/" />
|
|
+ <Option type="1" />
|
|
+ <Option compiler="gcc" />
|
|
+ <Compiler>
|
|
|
|
29: Создал коммит для вывода произведения:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "добавление вывода произведения"
|
|
[main c3e3a4c] добавление вывода произведения
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
30. Создал коммит с комментарием:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "добавление комментария"
|
|
[main 50f1265] добавление комментария
|
|
1 file changed, 2 insertions(+)
|
|
|
|
31. Откатил проект до предыдущей версии:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git reset --hard HEAD~1
|
|
HEAD is now at 3cf88ff добавление вывода произведения
|
|
|
|
32. Создал пару ключей:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ ssh-keygen
|
|
Generating public/private ed25519 key pair.
|
|
Enter file in which to save the key (/c/Users/krivo/.ssh/id_ed25519):
|
|
Created directory '/c/Users/krivo/.ssh'.
|
|
Enter passphrase for "/c/Users/krivo/.ssh/id_ed25519" (empty for no passphrase):
|
|
Enter same passphrase again:
|
|
Your identification has been saved in /c/Users/krivo/.ssh/id_ed25519
|
|
Your public key has been saved in /c/Users/krivo/.ssh/id_ed25519.pub
|
|
The key fingerprint is:
|
|
SHA256:0WABqH0PWOUm+pu2iej8CUNfZVfADvYxOkjVWWC1Kmc krivo@DESKTOP-73N9GOM
|
|
The key's randomart image is:
|
|
+--[ED25519 256]--+
|
|
| ..+*++*+ |
|
|
| . ooo+*. . |
|
|
| o +.o*=oo. |
|
|
| . o.+=ooo. |
|
|
| . ...oS.E |
|
|
| . . o .+ |
|
|
| o . . |
|
|
| . + o.+ |
|
|
| .+.+.=. |
|
|
+----[SHA256]-----+
|
|
|
|
33. Запустил и добавил ключ в агент:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ eval $(ssh-agent -s)
|
|
Agent pid 1746
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ ssh-add
|
|
Enter passphrase for /c/Users/krivo/.ssh/id_ed25519:
|
|
Identity added: /c/Users/krivo/.ssh/id_ed25519 (krivo@DESKTOP-73N9GOM)
|
|
|
|
|
|
34. Отобразил открытый ключ:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ cat ~/.ssh/id_ed25519.pub
|
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIJNM8HMUcGpOKis3FK03cBJmsha+hvLvLop9KBrhAg8 krivo@DESKTOP-73N9GOM
|
|
|
|
35. Отправил проект на сервер:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git remote add origin git@uit.mpei.ru:KrivovDA/cs-lab02.git
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git push -u origin main
|
|
The authenticity of host 'uit.mpei.ru (193.233.68.149)' can't be established.
|
|
ED25519 key fingerprint is SHA256:Q5w0UKEzQKA3J6NyMtjwCLvtAykoxdugIXjx6NwU4NA.
|
|
This key is not known by any other names.
|
|
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
|
|
Warning: Permanently added 'uit.mpei.ru' (ED25519) to the list of known hosts.
|
|
Enumerating objects: 18, done.
|
|
Counting objects: 100% (18/18), done.
|
|
Delta compression using up to 12 threads
|
|
Compressing objects: 100% (16/16), done.
|
|
Writing objects: 100% (18/18), 2.41 KiB | 1.20 MiB/s, done.
|
|
Total 18 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To uit.mpei.ru:KrivovDA/cs-lab02.git
|
|
* [new branch] main -> main
|
|
branch 'main' set up to track 'origin/main'.
|
|
|
|
36. Скопировал проект для боба:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob
|
|
$ git clone http://uit.mpei.ru/git/KrivovDA/cs-lab02.git project
|
|
Cloning into 'project'...
|
|
remote: Enumerating objects: 18, done.
|
|
remote: Counting objects: 100% (18/18), done.
|
|
remote: Compressing objects: 100% (16/16), done.
|
|
remote: Total 18 (delta 2), reused 0 (delta 0), pack-reused 0
|
|
Receiving objects: 100% (18/18), done.
|
|
Resolving deltas: 100% (2/2), done.
|
|
|
|
37. Настроил Git:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$ git config user.name 'Bob (KrivovDA)'
|
|
git config user.email 'Krivovda@mail.com'
|
|
|
|
38. Добавил коммит изменения Боба:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$ git commit -a -m "Изменения Боба"
|
|
[main b9ea1ff] Изменения Боба
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
39. Отправил измененения на сервер:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$ git push
|
|
warning: use of unencrypted HTTP remote URLs is not recommended; see https://ak
|
|
a.ms/gcm/unsaferemotes for more information.
|
|
Enumerating objects: 5, done.
|
|
Counting objects: 100% (5/5), done.
|
|
Delta compression using up to 12 threads
|
|
Compressing objects: 100% (3/3), done.
|
|
Writing objects: 100% (3/3), 384 bytes | 384.00 KiB/s, done.
|
|
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/KrivovDA/cs-lab02.git
|
|
3cf88ff..b9ea1ff main -> main
|
|
|
|
40. Получил изменения от имени Алисы:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git fetch
|
|
Enter passphrase for key '/c/Users/krivo/.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), 364 bytes | 60.00 KiB/s, done.
|
|
From uit.mpei.ru:KrivovDA/cs-lab02
|
|
3cf88ff..b9ea1ff main -> origin/main
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* b9ea1ff (origin/main, origin/HEAD) Изменения Боба
|
|
* 3cf88ff (HEAD -> main) добавление вывода произведения
|
|
* fcd0a28 добавление игнорирования файлов
|
|
* 9f3751e добавление вывода суммы и разности
|
|
* ef032cd изменённое тело кода
|
|
* cc901d0 build: добавлен файл проекта
|
|
* fe6b1fb code: заготовка программы~
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git pull --ff-only
|
|
Enter passphrase for key '/c/Users/krivo/.ssh/id_ed25519':
|
|
Updating 3cf88ff..b9ea1ff
|
|
Fast-forward
|
|
main.cpp | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
41. Попробовал внести изменения с машины Боба не с последнего существующего коммита:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$ git push
|
|
To http://uit.mpei.ru/git/KrivovDA/cs-lab02.git
|
|
! [rejected] main -> main (non-fast-forward)
|
|
error: failed to push some refs to 'http://uit.mpei.ru/git/KrivovDA/cs-lab02.gi
|
|
t'
|
|
hint: Updates were rejected because the tip of your current branch is behind
|
|
hint: its remote counterpart. If you want to integrate the remote changes,
|
|
hint: use 'git pull' before pushing again.
|
|
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$
|
|
|
|
42. Сравнение main обоих пользователей и отображение место расхождения:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$ git rebase origin/main
|
|
warning: skipped previously applied commit 2dd177b
|
|
hint: use --reapply-cherry-picks to include skipped commits
|
|
hint: Disable this message with "git config set advice.skippedCherryPicks false
|
|
"
|
|
Auto-merging main.cpp
|
|
CONFLICT (content): Merge conflict in main.cpp
|
|
error: could not apply 24ba905... добавление минимума
|
|
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".
|
|
hint: Disable this message with "git config set advice.mergeConflict false"
|
|
Could not apply 24ba905... добавление минимума
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
cout << "Enter A and B: ";
|
|
int a, b;
|
|
cin >> a >> b;
|
|
cout << "A + B = " << a + b << '\n'
|
|
<< "A - B = " << a - b << '\n'
|
|
<< "A * B = " << a * b << '\n'
|
|
<<<<<<< HEAD
|
|
<< "A / B = " << a / b << '\n'
|
|
if (a < b) cout << "max = " << b;
|
|
else: cout << "max = " << a;
|
|
=======
|
|
<< "A / B = " << a / b << '\n';
|
|
if (a < b) cout << "min = " << a;
|
|
else: cout << "min = " << b;
|
|
>>>>>>> 24ba905 (добавление минимума)
|
|
}
|
|
|
|
43. Изменил код чтобы он содержал правки и от Алисы и от Боба и отправил на сервер:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main|REBASE 1/1)
|
|
$ git add main.cpp
|
|
git rebase --continue
|
|
hint: Waiting for your editor to close the file... unix2dos: converting file C:
|
|
/Users/krivo/Desktop/lab02/bob/project/.git/COMMIT_EDITMSG to DOS format...
|
|
dos2unix: converting file C:/Users/krivo/Desktop/lab02/bob/project/.git/COMMIT_
|
|
EDITMSG to Unix format...
|
|
[detached HEAD 25e5ed6] добавление минимума
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
Successfully rebased and updated refs/heads/main.
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/bob/project (main)
|
|
$ git push
|
|
Enumerating objects: 5, done.
|
|
Counting objects: 100% (5/5), done.
|
|
Delta compression using up to 12 threads
|
|
Compressing objects: 100% (3/3), done.
|
|
Writing objects: 100% (3/3), 420 bytes | 420.00 KiB/s, done.
|
|
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/KrivovDA/cs-lab02.git
|
|
adfd84b..25e5ed6 main -> main
|
|
|
|
44. Созданил и перешел в ветку double:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git branch double
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git checkout double
|
|
M main.cpp
|
|
Switched to branch 'double'
|
|
|
|
45. Изменил тип данных на double и закомитил это:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (double)
|
|
$ git commit -a -m "изменение переменных на double"
|
|
[double 368f2a2] изменение переменных на double
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
46. Синхронизировал main:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (double)
|
|
$ git checkout main
|
|
Switched to branch 'main'
|
|
Your branch is up to date with 'origin/main'.
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git fetch
|
|
Enter passphrase for key '/c/Users/krivo/.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), 400 bytes | 66.00 KiB/s, done.
|
|
From uit.mpei.ru:KrivovDA/cs-lab02
|
|
adfd84b..25e5ed6 main -> origin/main
|
|
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git pull --ff-only
|
|
Enter passphrase for key '/c/Users/krivo/.ssh/id_ed25519':
|
|
Updating adfd84b..25e5ed6
|
|
Fast-forward
|
|
main.cpp | 7 +++++--
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
47. Слил ветку double в main:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git merge double
|
|
Auto-merging main.cpp
|
|
CONFLICT (content): Merge conflict in main.cpp
|
|
Automatic merge failed; fix conflicts and then commit the result.
|
|
|
|
48. Отправил данные на сервер:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git push
|
|
Enter passphrase for key '/c/Users/krivo/.ssh/id_ed25519':
|
|
Enumerating objects: 10, done.
|
|
Counting objects: 100% (10/10), done.
|
|
Delta compression using up to 12 threads
|
|
Compressing objects: 100% (6/6), done.
|
|
Writing objects: 100% (6/6), 763 bytes | 763.00 KiB/s, done.
|
|
Total 6 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To uit.mpei.ru:KrivovDA/cs-lab02.git
|
|
25e5ed6..25d9594 main -> main
|
|
|
|
49. История веток:
|
|
krivo@DESKTOP-73N9GOM MINGW64 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* 25d9594 (HEAD -> main, origin/main, origin/HEAD) изменение переменных
|
|
на double
|
|
|\
|
|
| * 368f2a2 (double) изменение переменных на double
|
|
* | 25e5ed6 добавление минимума
|
|
|/
|
|
* adfd84b добавление максимума
|
|
* 1addccd добавление деления
|
|
* b9ea1ff Изменения Боба
|
|
* 3cf88ff добавление вывода произведения
|
|
* fcd0a28 добавление игнорирования файлов
|
|
* 9f3751e добавление вывода суммы и разности
|
|
* ef032cd изменённое тело кода
|
|
* cc901d0 build: добавлен файл проекта
|
|
* fe6b1fb code: заготовка программы
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|