Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
798 строки
30 KiB
Plaintext
798 строки
30 KiB
Plaintext
Отчет по лабораторной работе № 2 "Система контроля версий Git"
|
|
|
|
Выполнил: Матус С.В.
|
|
Группа: А-01-23
|
|
Проверил: Козлюк Д. А.
|
|
|
|
Примечание: работа выполнялась на Windows.
|
|
|
|
1. Создал на рабочем столе каталог lab02 и запустил в нем Git Bash, приглашение:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02
|
|
$
|
|
|
|
|
|
2. Просмотрел файлы в рабочем каталоге можно командой "ls" --- пусто:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02
|
|
$ ls
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02
|
|
$
|
|
|
|
|
|
3. Создал каталоги Алисы и Боба, создал каталог "project",
|
|
изучил команду "cd" в процессе:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02
|
|
$ mkdir alice
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02
|
|
$ mkdir bob
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02
|
|
$ cd alice
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice
|
|
$ mkdir project
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice
|
|
$ cd project
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project
|
|
$ cd ..
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice
|
|
$ cd project
|
|
|
|
|
|
4. Инициализировал репозитарий:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project
|
|
$ git init
|
|
Initialized empty Git repository in C:/Users/Sergey/Desktop/lab02/alice/project/.git/
|
|
|
|
У меня имя ветки по умолчанию не настроено.
|
|
Git создал ветку под названием master, что видно в приглашении терминала.
|
|
Подсказка не появилась.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
$ git config user.name 'Alice (MatusSV)'
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
$ git config user.email 'MatusSV@mpei.ru'
|
|
|
|
Запустил CodeBlocks и создал проект в репозитарии Алисы.
|
|
|
|
5. Просмотрел состояние рабочей копии
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
$ git status
|
|
On branch master //Название текущий ветки.
|
|
|
|
No commits yet //Коммитов нет.
|
|
|
|
Untracked files: //Каждый файл ниже не занесён в индекс.
|
|
(use "git add <file>..." to include in what will be committed)
|
|
bin/
|
|
main.cpp
|
|
obj/
|
|
project.cbp
|
|
project.layout
|
|
|
|
nothing added to commit but untracked files present (use "git add" to track) //Нет файлов в текущем коммите. Подсказка с командой git add.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
git add main.cpp
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
$ git status
|
|
On branch master
|
|
|
|
No commits yet
|
|
|
|
Changes to be committed: //Начал отслеживаться добавленный файл main.cpp
|
|
(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
|
|
project.layout
|
|
|
|
6. Создал два коммита
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
$ git commit -m 'code: заготовка программы'
|
|
[master (root-commit) 20f6734] code: заготовка программы
|
|
1 file changed, 9 insertions(+)
|
|
create mode 100644 main.cpp
|
|
|
|
Изменил имя ветки на main:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (master)
|
|
$ git branch -m main
|
|
|
|
Sergey@HOME-PC MINGW32 ~/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
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -m 'build: добавлен файл проекта'
|
|
[main 347d644] build: добавлен файл проекта
|
|
1 file changed, 40 insertions(+)
|
|
create mode 100644 project.cbp
|
|
|
|
Sergey@HOME-PC MINGW32 ~/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.layout
|
|
|
|
no changes added to commit (use "git add" and/or "git commit -a")
|
|
|
|
7. Добавил в код вывод суммы/разности и сделал с ними коммит в один шаг.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "code: добавлен вывод суммы и разности"
|
|
[main 41b9b83] code: добавлен вывод суммы и разности
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
Создал файл .gitignore и внёс в него /bin
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
git status
|
|
On branch main
|
|
Untracked files:
|
|
(use "git add <file>..." to include in what will be committed)
|
|
.gitignore
|
|
obj/
|
|
project.depend
|
|
project.layout
|
|
|
|
nothing added to commit but untracked files present (use "git add" to track)
|
|
|
|
8. Занёс в список игнорируемых каталоги bin и obj и файлы *.layout и сделал коммит.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
git status
|
|
On branch main
|
|
Untracked files:
|
|
(use "git add <file>..." to include in what will be committed)
|
|
.gitignore
|
|
project.depend
|
|
|
|
nothing added to commit but untracked files present (use "git add" to track)
|
|
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git add .gitignore
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -m 'git: добавлен список игнорируемых файлов'
|
|
[main a204e43] git: добавлен список игнорируемых файлов
|
|
1 file changed, 3 insertions(+)
|
|
create mode 100644 .gitignore
|
|
|
|
9. Провёл работу с журналом репозитария.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log
|
|
commit a204e4399a164ef9bcb104e0de8b779e284222d7 (HEAD -> main)
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:21:46 2024 +0300
|
|
|
|
git: добавлен список игнорируемых файлов
|
|
|
|
commit 41b9b83768c1d46335fa69c27300d0f5cd0429e6
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:13:09 2024 +0300
|
|
|
|
code: добавлен вывод суммы и разности
|
|
|
|
commit 347d644100336d6f0612861b01883b8489140fb2
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:02:19 2024 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
commit 20f6734da4495a079dbfbce672f822589b543bb8
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:00:57 2024 +0300
|
|
|
|
code: заготовка программы
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --stat
|
|
commit a204e4399a164ef9bcb104e0de8b779e284222d7 (HEAD -> main) //Показан хэш коммита
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru> //Информация о пользователе, сделавшего коммит
|
|
Date: Mon Apr 1 10:21:46 2024 +0300 //Время коммита
|
|
|
|
git: добавлен список игнорируемых файлов //Сообщение коммита
|
|
|
|
.gitignore | 3 +++ //Изменённый файл. 3 добавленных строки (/bin, /obj, *.layout)
|
|
1 file changed, 3 insertions(+) //Сводка
|
|
|
|
commit 41b9b83768c1d46335fa69c27300d0f5cd0429e6
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:13:09 2024 +0300
|
|
|
|
code: добавлен вывод суммы и разности
|
|
|
|
main.cpp | 7 +++++--
|
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
|
commit 347d644100336d6f0612861b01883b8489140fb2
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:02:19 2024 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
project.cbp | 40 ++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 40 insertions(+)
|
|
|
|
commit 20f6734da4495a079dbfbce672f822589b543bb8
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:00:57 2024 +0300
|
|
|
|
code: заготовка программы
|
|
|
|
main.cpp | 9 +++++++++
|
|
1 file changed, 9 insertions(+)
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate
|
|
a204e43 (HEAD -> main) git: добавлен список игнорируемых файлов
|
|
41b9b83 code: добавлен вывод суммы и разности
|
|
347d644 build: добавлен файл проекта
|
|
20f6734 code: заготовка программы
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* a204e43 (HEAD -> main) git: добавлен список игнорируемых файлов
|
|
* 41b9b83 code: добавлен вывод суммы и разности
|
|
* 347d644 build: добавлен файл проекта
|
|
* 20f6734 code: заготовка программы
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --grep "build:"
|
|
commit 347d644100336d6f0612861b01883b8489140fb2
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:02:19 2024 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log -- project.cbp
|
|
commit 347d644100336d6f0612861b01883b8489140fb2
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:02:19 2024 +0300
|
|
|
|
build: добавлен файл проекта
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git show HEAD
|
|
commit a204e4399a164ef9bcb104e0de8b779e284222d7 (HEAD -> main)
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:21:46 2024 +0300
|
|
|
|
git: добавлен список игнорируемых файлов
|
|
|
|
diff --git a/.gitignore b/.gitignore
|
|
new file mode 100644
|
|
index 0000000..d85abef
|
|
--- /dev/null
|
|
+++ b/.gitignore
|
|
@@ -0,0 +1,3 @@
|
|
+/bin
|
|
+/obj
|
|
+/*.layout
|
|
|
|
10. Просмотрен предпоследний коммит тремя способами.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git show HEAD~1
|
|
$ git show main~1
|
|
$ git show 41b9b83768c1d46335fa69c27300d0f5cd0429e6
|
|
commit 41b9b83768c1d46335fa69c27300d0f5cd0429e6
|
|
Author: Alice (MatusSV) <MatusSV@mpei.ru>
|
|
Date: Mon Apr 1 10:13:09 2024 +0300
|
|
|
|
code: добавлен вывод суммы и разности
|
|
|
|
diff --git a/main.cpp b/main.cpp
|
|
index b4392ec..fd75bba 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';
|
|
}
|
|
|
|
11. Просмотрел изменения в рабочей копии:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git diff
|
|
diff --git a/main.cpp b/main.cpp //Разница в файле main.cpp
|
|
index fd75bba..91f8982 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';
|
|
}
|
|
|
|
12. Просмотрел изменения между самым первым коммитом и коммитом, добавляющим вывод разности:
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git diff HEAD~3 HEAD~1
|
|
diff --git a/main.cpp b/main.cpp
|
|
index b4392ec..fd75bba 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" extension_auto="1" />
|
|
+ <Option object_output="obj/Release/" />
|
|
+ <Option type="1" />
|
|
+ <Option compiler="gcc" />
|
|
+ <Compiler>
|
|
+ <Add option="-O2" />
|
|
+ </Compiler>
|
|
+ <Linker>
|
|
+ <Add option="-s" />
|
|
+ </Linker>
|
|
+ </Target>
|
|
+ </Build>
|
|
+ <Compiler>
|
|
+ <Add option="-Wall" />
|
|
+ <Add option="-fexceptions" />
|
|
+ </Compiler>
|
|
+ <Unit filename="main.cpp" />
|
|
+ <Extensions>
|
|
+ <lib_finder disable_auto="1" />
|
|
+ </Extensions>
|
|
+ </Project>
|
|
+</CodeBlocks_project_file>
|
|
|
|
13. Сделан коммит вывода произведения.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "code: добавлен вывод произведения"
|
|
[main c31a2e3] code: добавлен вывод произведения
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
14. Откат на предыдущий коммит и откат отдельного файла.
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git reset --hard HEAD~1
|
|
HEAD is now at a204e43 git: добавлен список игнорируемых файлов
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git checkout HEAD -- main.cpp
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ ssh-keygen
|
|
Generating public/private ed25519 key pair.
|
|
Enter file in which to save the key (/c/Users/Gamer/.ssh/id_ed25519):
|
|
Created directory '/c/Users/Gamer/.ssh'.
|
|
Enter passphrase (empty for no passphrase):
|
|
Enter same passphrase again:
|
|
Your identification has been saved in /c/Users/Gamer/.ssh/id_ed25519
|
|
Your public key has been saved in /c/Users/Gamer/.ssh/id_ed25519.pub
|
|
The key fingerprint is:
|
|
SHA256:/e2ZLwbe+1/cJ6c2Rh8B5q4r9IGg2g+2DE1fL7DMOiQ Gamer@GameCenter
|
|
The key's randomart image is:
|
|
+--[ED25519 256]--+
|
|
| |
|
|
| o |
|
|
| o . |
|
|
| . . . . |
|
|
| ...S.o . .|
|
|
| Eoo+ +o.o.o.o.|
|
|
| .=+ =...o++o.B|
|
|
| .+o+ ..o..B*+|
|
|
| +o. ...+**=|
|
|
+----[SHA256]-----+
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ eval $(ssh-agent -s)
|
|
Agent pid 1302
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ ssh-add
|
|
Enter passphrase for /c/Users/Sergey/.ssh/id_ed25519:
|
|
Identity added: /c/Users/Sergey/.ssh/id_ed25519 (Sergey@HOME-PC)
|
|
|
|
Sergey@HOME-PC MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ cat ~/.ssh/id_ed25519.pub
|
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICs8K4VkB1gYLTQKg5XDnWZzP7cEdyfHv5/MzTNNukCq Sergey@HOME-PC
|
|
|
|
15. Отправка репозитария на сервер (из лаборатории):
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git remote add origin http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git push -u origin main
|
|
Enumerating objects: 12, done.
|
|
Counting objects: 100% (12/12), done.
|
|
Compressing objects: 100% (10/10), done.
|
|
Writing objects: 100% (12/12), 1.77 KiB | 258.00 KiB/s, done.
|
|
Total 12 (delta 0), reused 0 (delta 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
* [new branch] main -> main
|
|
Branch 'main' set up to track remote branch 'main' from 'origin'.
|
|
|
|
16. Получен проект с сервера.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob
|
|
$ git clone http://uit.mpei.ru/git/MatusSV/cs-lab02.git project
|
|
Cloning into 'project'...
|
|
remote: Enumerating objects: 12, done.
|
|
remote: Counting objects: 100% (12/12), done.
|
|
remote: Compressing objects: 100% (10/10), done.
|
|
remote: Total 12 (delta 0), reused 0 (delta 0), pack-reused 0
|
|
Unpacking objects: 100% (12/12), done.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob
|
|
$ cd project
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git config user.name 'Bob (MatusSV)'
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git config user.email 'MatusSV@mpei.ru'
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git commit -a -m "code: добавлен вывод операции произведения"
|
|
[main 49a9e66] code: добавлен вывод операции произведения
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
17. Отправление коммита на сервер.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git push
|
|
Enumerating objects: 5, done.
|
|
Counting objects: 100% (5/5), done.
|
|
Compressing objects: 100% (3/3), done.
|
|
Writing objects: 100% (3/3), 433 bytes | 216.00 KiB/s, done.
|
|
Total 3 (delta 1), reused 0 (delta 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
a204e43..49a9e66 main -> main
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ 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), done.
|
|
From http://uit.mpei.ru/git/MatusSV/cs-lab02
|
|
a204e43..49a9e66 main -> origin/main
|
|
|
|
18. Просмотрена история всех веток.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* 49a9e66 (origin/main) code: добавлен вывод операции произведения
|
|
* a204e43 (HEAD -> main) git: добавлен список игнорируемых файлов
|
|
* 41b9b83 code: добавлен вывод суммы и разности
|
|
* 347d644 build: добавлен файл проекта
|
|
* 20f6734 code: заготовка программы
|
|
|
|
19. Продвинул ветку main к скачанной версии.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git pull --ff-only
|
|
Updating a204e43..49a9e66
|
|
Fast-forward
|
|
main.cpp | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
20. Добавил вывод деления и сделал коммит от лица Алисы, затем отправил его на сервер и синхронизировал у Боба.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "code: добавлен вывод операции деления"
|
|
[main 52b2c46] code: добавлен вывод операции деления
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git push
|
|
Enumerating objects: 5, done.
|
|
Counting objects: 100% (5/5), done.
|
|
Compressing objects: 100% (3/3), done.
|
|
Writing objects: 100% (3/3), 430 bytes | 215.00 KiB/s, done.
|
|
Total 3 (delta 1), reused 0 (delta 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
49a9e66..52b2c46 main -> main
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git pull --ff-only
|
|
Updating 49a9e66..52b2c46
|
|
Fast-forward
|
|
main.cpp | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
21. Добавил вывод максимума у Алисы и отправил коммит на сервер.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git commit -a -m "code: добавлен вывод максимума"
|
|
[main b8a5ec8] code: добавлен вывод максимума
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git push
|
|
Enumerating objects: 5, done.
|
|
Counting objects: 100% (5/5), done.
|
|
Compressing objects: 100% (3/3), done.
|
|
Writing objects: 100% (3/3), 424 bytes | 212.00 KiB/s, done.
|
|
Total 3 (delta 1), reused 0 (delta 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
52b2c46..b8a5ec8 main -> main
|
|
|
|
22. Добавил вывод минимума у Боба. Сделал коммит и попытался отправить на сервер.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git commit -a -m "code: äîáàâëåí âûâîä ìèíèìóìà"
|
|
[main 577fbe4] code: äîáàâëåí âûâîä ìèíèìóìà
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git push
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
! [rejected] main -> main (fetch first)
|
|
error: failed to push some refs to 'http://uit.mpei.ru/git/MatusSV/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.
|
|
|
|
23. От лица Боба загрузил коммиты из удалённого хранилища и отобразил историю всех веток.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ 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), done.
|
|
From http://uit.mpei.ru/git/MatusSV/cs-lab02
|
|
52b2c46..b8a5ec8 main -> origin/main
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* 577fbe4 (HEAD -> main) code: добавлен вывод минимума
|
|
| * b8a5ec8 (origin/main, origin/HEAD) code: добавлен вывод максимума
|
|
|/
|
|
* 52b2c46 code: добавлен вывод операции деления
|
|
* 49a9e66 code: добавлен вывод операции произведения
|
|
* a204e43 git: добавлен список игнорируемых файлов
|
|
* 41b9b83 code: добавлен вывод суммы и разности
|
|
* 347d644 build: добавлен файл проекта
|
|
* 20f6734 code: заготовка программы
|
|
|
|
|
|
|
|
24. Попытка переместить коммит поверх коммита Алисы.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git rebase origin/main
|
|
First, rewinding head to replay your work on top of it...
|
|
Applying: code: добавлен вывод минимума
|
|
Using index info to reconstruct a base tree...
|
|
M main.cpp
|
|
Falling back to patching base and 3-way merge...
|
|
Auto-merging main.cpp
|
|
CONFLICT (content): Merge conflict in main.cpp
|
|
error: Failed to merge in the changes.
|
|
hint: Use 'git am --show-current-patch' to see the failed patch
|
|
Patch failed at 0001 code: добавлен вывод минимума
|
|
Resolve all conflicts manually, mark them as resolved with
|
|
"git add/rm <conflicted_files>", then run "git rebase --continue".
|
|
You can instead skip this commit: run "git rebase --skip".
|
|
To abort and get back to the state before "git rebase", run "git rebase --abort".
|
|
|
|
25. Просмотр состояния хранилища у Боба
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main|REBASE 1/1)
|
|
$ git status
|
|
rebase in progress; onto b8a5ec8 //У Боба отдельная ветка поверх последнего коммита Алисы.
|
|
You are currently rebasing branch 'main' on 'b8a5ec8'.
|
|
(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 reset HEAD <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")
|
|
|
|
26. Добавление файла main.cpp и продолжение прерванной операции rebase с отправкой на сервер:
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main|REBASE 1/1)
|
|
$ git add main.cpp
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main|REBASE 1/1)
|
|
$ git rebase --continue
|
|
Applying: code: добавлен вывод максимума
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* 8e170ee (HEAD -> main) code: добавлен вывод минимума
|
|
b8a5ec8 (origin/main, origin/HEAD) code: добавлен вывод максимума
|
|
* 52b2c46 code: добавлен вывод операции деления
|
|
* 49a9e66 code: добавлен вывод операции произведения
|
|
* a204e43 git: добавлен список игнорируемых файлов
|
|
* 41b9b83 code: добавлен вывод суммы и разности
|
|
* 347d644 build: добавлен файл проекта
|
|
* 20f6734 code: заготовка программы
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/bob/project (main)
|
|
$ git push
|
|
Enumerating objects: 5, done.
|
|
Counting objects: 100% (5/5), done.
|
|
Compressing objects: 100% (3/3), done.
|
|
Writing objects: 100% (3/3), 423 bytes | 211.00 KiB/s, done.
|
|
Total 3 (delta 1), reused 0 (delta 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
b8a5ec8..8e170ee main -> main
|
|
|
|
|
|
27. Создание и переключение на ветку double у Алисы:
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git branch double
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git checkout double
|
|
Switched to branch 'double'
|
|
|
|
28. Создан коммит на изменение типа переменных a,b на double:
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (double)
|
|
$ git commit -a -m "code: èçìåí¸í òèï ïåðåìåííûõ a, b íà double"
|
|
[double 406b8ad] code: èçìåí¸í òèï ïåðåìåííûõ a, b íà double
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
29. Синхронизация main у Алисы:
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git pull --ff-only
|
|
Updating b8a5ec8..8e170ee
|
|
Fast-forward
|
|
main.cpp | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* 406b8ad (double) code: изменён тип переменных a, b на double
|
|
| * 8e170ee (HEAD -> main, origin/main) code: добавлен вывод минимума
|
|
|/
|
|
* b8a5ec8 code: добавлен вывод максимума
|
|
* 52b2c46 code: добавлен вывод операции деления
|
|
* 49a9e66 code: добавлен вывод операции произведения
|
|
* a204e43 git: добавлен список игнорируемых файлов
|
|
* 41b9b83 code: добавлен вывод суммы и разности
|
|
* 347d644 build: добавлен файл проекта
|
|
* 20f6734 code: заготовка программы
|
|
|
|
30. Слияние ветки double в main и отправка на сервер.
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git merge double
|
|
Auto-merging main.cpp
|
|
hint: Waiting for your editor to close the file... 2 [sig] bash 3748! sigpacket::process: Suppressing signal 18 to win32 process (pid 3568)
|
|
Merge made by the 'recursive' strategy.
|
|
main.cpp | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git push
|
|
Enumerating objects: 10, done.
|
|
Counting objects: 100% (10/10), done.
|
|
Compressing objects: 100% (6/6), done.
|
|
Writing objects: 100% (6/6), 772 bytes | 193.00 KiB/s, done.
|
|
Total 6 (delta 2), reused 0 (delta 0)
|
|
remote: . Processing 1 references
|
|
remote: Processed 1 references in total
|
|
To http://uit.mpei.ru/git/MatusSV/cs-lab02.git
|
|
8e170ee..69d7581 main -> main
|
|
|
|
u113-04@PROG-10 MINGW32 ~/Desktop/lab02/alice/project (main)
|
|
$ git log --oneline --decorate --all --graph
|
|
* 69d7581 (HEAD -> main, origin/main) code: слияние ветки double с main code: слияние ветки double с main
|
|
|\
|
|
| * 406b8ad (double) code: изменён тип переменных a, b на double
|
|
* | 8e170ee code: добавлен вывод минимума
|
|
|/
|
|
* b8a5ec8 code: добавлен вывод максимума
|
|
* 52b2c46 code: добавлен вывод операции деления
|
|
* 49a9e66 code: добавлен вывод операции произведения
|
|
* a204e43 git: добавлен список игнорируемых файлов
|
|
* 41b9b83 code: добавлен вывод суммы и разности
|
|
* 347d644 build: добавлен файл проекта
|
|
* 20f6734 code: заготовка программы
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|