Отчет по лабораторной работе № 2 "Система контроля версий Git" Выполнил: Васильев И.Н. Группа: А-02-23 Проверил: Примечание: работа выполнялась на Windows. 1. Создал на рабочем столе каталог lab02 и запустил в нем Git Bash, приглашение: Nick@S340 MINGW64 ~/Desktop/lab2 $ 2. Просмотрел файлы в рабочем каталоге можно командой "ls" --- пусто: Nick@S340 MINGW64 ~/Desktop/lab2 $ ls Nick@S340 MINGW64 ~/Desktop/lab2 $ 3. Создал каталоги Алисы и Боба, создал каталог "project", изучил команду "cd" в процессе: Nick@S340 MINGW64 ~/Desktop/lab2 $ mkdir bob Nick@S340 MINGW64 ~/Desktop/lab2 $ cd alice Nick@S340 MINGW64 ~/Desktop/lab2/alice $ mkdir project Nick@S340 MINGW64 ~/Desktop/lab2/alice $ cd .. Nick@S340 MINGW64 ~/Desktop/lab2 $ cd alice Nick@S340 MINGW64 ~/Desktop/lab2/alice $ cd project Nick@S340 MINGW64 ~/Desktop/lab2/alice/project $ 4. Инициализировал репозитарий: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project $ git init Initialized empty Git repository in C:/Users/Nick/Desktop/lab2/alice/project/.git/ Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ У меня имя ветки по умолчанию не настроено. Git создал ветку под названием master, что видно в приглашении терминала. Я принял решение не менять имя ветки. 5. Настраиваю репозитарий Алисы, чтобы коммиты были от ее имени: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git config user.name 'Alice (VasilyevIN)' Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git config user.email 'VasilyevIN@mpei.ru' Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ 6. Создаю коммиты по следующему алгоритму: Запустите CodeBlocks и создайте проект в репозитарии Алисы: Project title: project Folder to create project in: C:\Users\user\Desktop\lab02\alice Project filename: project.cbp Resulting filename: C:\Users\user\Desktop\lab02\alice\project\project.cbp 7. Занесение файлов под контроль версий Собираю проект и проверяю статус: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master No commits yet Untracked files: (use "git add ..." 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) Добавим файл main.cpp в индекс, то есть в набор изменений, который войдет в очередной коммит. Так как этот файл ранее не отслеживался Git, то говорят, что файл «заносят под Git» или «начинают отслеживать». Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git add main.cpp и проверяем статус еще раз: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master No commits yet Changes to be committed: (use "git rm --cached ..." to unstage) new file: main.cpp Untracked files: (use "git add ..." to include in what will be committed) bin/ obj/ project.cbp замечаем, что main.cpp добавился в закомичнные файлы Выполним коммит с файлом main.cpp и коротким сообщением: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git commit -m 'code: заготовка программы' [master (root-commit) a55d3e8] code: заготовка программы 1 file changed, 9 insertions(+) create mode 100644 main.cpp повторим с project.cpb: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git add project.cbp warning: in the working copy of 'project.cbp', LF will be replaced by CRLF the next time Git touches it Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git commit -m 'build: добавлен файл проекта' [master 07300fb] build: добавлен файл проекта 1 file changed, 40 insertions(+) create mode 100644 project.cbp 8.Создание коммитов с изменениями Заменим тело функции main() на ввод двух чисел: cout << "Enter A and B: "; int a, b; cin >> a >> b; билдим и проверяем статус: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: main.cpp Untracked files: (use "git add ..." to include in what will be committed) bin/ obj/ no changes added to commit (use "git add" and/or "git commit -a") коммитим изменения: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git add main.cpp Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git commit -m 'Добавили ввод двух чисел в main()' [master 82e72a4] Добавили ввод двух чисел в main() 1 file changed, 3 insertions(+), 2 deletions(-) Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master Untracked files: (use "git add ..." to include in what will be committed) bin/ obj/ nothing added to commit but untracked files present (use "git add" to track) добавляем вывод суммы: cout << "A + B = " << a + b << '\n' и билдим, проверяем статус. Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: main.cpp Untracked files: (use "git add ..." to include in what will be committed) bin/ obj/ no changes added to commit (use "git add" and/or "git commit -a") коммитим: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git add -u Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git commit -m 'code: заготовка программы' [master a505761] code: заготовка программы 1 file changed, 1 insertion(+) повторим с разностью: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: main.cpp Untracked files: (use "git add ..." to include in what will be committed) bin/ obj/ no changes added to commit (use "git add" and/or "git commit -a") Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git commit -a -m 'code: добавили разность' [master c44ebb8] code: добавили разность 1 file changed, 1 insertion(+) 9. Игнорирование файлов создаем пустой файл в codeblox и вписываем в него /bin и /obj, после чего сохраняем в project проверяем статус: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master Untracked files: (use "git add ..." to include in what will be committed) .gitignore nothing added to commit but untracked files present (use "git add" to track) коммитим гит игнор 10. просматриваем историю: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git log commit 549e8c16a8e03f2da0f595d9ee8de068f3235e71 (HEAD -> master) Author: Alice (VasilyevIN) Date: Mon Mar 25 00:20:10 2024 +0300 git: добавлены игнорируемые файлы commit c44ebb879a22a19577579c4ebb362595153f2350 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:03:10 2024 +0300 code: добавили разность commit a50576165f0b064e31ce05382fe1f24761483ad1 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:58:38 2024 +0300 code: добавили сумму commit 82e72a4f5fd2cec49c679c2ff2aba53c24f13b3b Author: Alice (VasilyevIN) Date: Sun Mar 24 23:40:28 2024 +0300 Добавили ввод двух чисел в main() commit 07300fbcdcbb49e8f801c2bfc0ad845fc754bba4 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:32:52 2024 +0300 build: добавлен файл проекта commit a55d3e8a95d25d85c5d904a93319b57ba6c4f16e Author: Alice (VasilyevIN) Date: Sun Mar 24 23:28:58 2024 +0300 code: заготовка программы Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git log --oneline --decorate 549e8c1 (HEAD -> master) git: добавлены игнорируемые файлы c44ebb8 code: добавили разность a505761 code: добавили сумму 82e72a4 Добавили ввод двух чисел в main() 07300fb build: добавлен файл проекта a55d3e8 code: заготовка программы простматриваем конкретный коммит: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git show a505761 commit a50576165f0b064e31ce05382fe1f24761483ad1 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:58:38 2024 +0300 code: добавили сумму diff --git a/main.cpp b/main.cpp index b903969..b2f34ce 100644 --- a/main.cpp +++ b/main.cpp @@ -7,4 +7,5 @@ int main() cout << "Enter A and B: "; int a, b; cin >> a >> b; +cout << "A + B = " << a + b << '\n'; } 11. Просмотр изменений: просмотрим изменения в последних двух коммитах Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git diff HEAD~2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c7473d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/bin +/obj diff --git a/main.cpp b/main.cpp index b2f34ce..fc78fd6 100644 --- a/main.cpp +++ b/main.cpp @@ -8,4 +8,5 @@ cout << "Enter A and B: "; int a, b; cin >> a >> b; cout << "A + B = " << a + b << '\n'; +cout << "A - B = " << a - b << '\n'; } тут отображается изменение от нынешнего до предпредыдущего коммита сравним изменения с первого коммита до коммита с разностью: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git diff a55d3e8 549e8c1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c7473d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/bin +/obj diff --git a/main.cpp b/main.cpp index b4392ec..fc78fd6 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'; +cout << "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 @@ + + + + + + 12.Откат изменений Вписываем вывод произведений в main.cpp: cout << "A - B = " << a - b << '\n'; билдим и статус проверяем Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git restore ..." to discard changes in working directory) modified: main.cpp no changes added to commit (use "git add" and/or "git commit -a") комиттим майн.кпп и проверяем статус Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git add main.cpp Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git commit -m 'Добавили вывод произведения' [master 2b753e8] Добавили вывод произведения 1 file changed, 1 insertion(+) Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git status On branch master nothing to commit, working tree clean проверим весь лог Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git log --oneline --decorate 2b753e8 (HEAD -> master) Добавили вывод произведения 549e8c1 git: добавлены игнорируемые файлы c44ebb8 code: добавили разность a505761 code: добавили сумму 82e72a4 Добавили ввод двух чисел в main() 07300fb build: добавлен файл проекта a55d3e8 code: заготовка программы делаем откат Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git reset --hard HEAD~1 HEAD is now at 549e8c1 git: добавлены игнорируемые файлы Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git log --oneline --decorate 549e8c1 (HEAD -> master) git: добавлены игнорируемые файлы c44ebb8 code: добавили разность a505761 code: заготовка программы 82e72a4 Добавили ввод двух чисел в main() 07300fb build: добавлен файл проекта a55d3e8 code: заготовка программы 13. Рег на сервере 14. ssh-keygen создаем ключ и вводим ему пароли Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ ssh-keygen Generating public/private ed25519 key pair. Enter file in which to save the key (/c/Users/Nick/.ssh/id_ed25519): Created directory '/c/Users/Nick/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/Nick/.ssh/id_ed25519 Your public key has been saved in /c/Users/Nick/.ssh/id_ed25519.pub The key fingerprint is: SHA256:adFCRijbJG+JGUskXSM+ergulWHlkesgKRTlT1yenR4 Nick@S340 The key's randomart image is: +--[ED25519 256]--+ | .++ooo++ | | ..o@.=+o.. | |.. =o^ +oE. | |+ +oX.= .+. | |.oo=.o S. | | oo. . | | .. | |.. | | .. | +----[SHA256]-----+ 15. запускаем агент Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ eval $(ssh-agent -s) Agent pid 396 перед этим короче переименовываем еще мастера в мейна и остальную фигню вписываем: Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git branch -m main Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (master) $ git remote add origin git@uit.mpei.ru:VasilyevIN/cs-lab02.git Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git push -u origin main The authenticity of host 'uit.mpei.ru (10.1.6.13)' 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. Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enumerating objects: 21, done. Counting objects: 100% (21/21), done. Delta compression using up to 4 threads Compressing objects: 100% (19/19), done. Writing objects: 100% (21/21), 2.63 KiB | 672.00 KiB/s, done. Total 21 (delta 4), reused 0 (delta 0), pack-reused 0 (from 0) remote: . Processing 1 references remote: Processed 1 references in total To uit.mpei.ru:VasilyevIN/cs-lab02.git * [new branch] main -> main branch 'main' set up to track 'origin/main'. 16. боб получил Nick@S340 MINGW64 ~/Desktop/lab2/bob $ git clone git@uit.mpei.ru:VasilyevIN/cs-lab02.git Cloning into 'cs-lab02'... Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': remote: Enumerating objects: 21, done. remote: Counting objects: 100% (21/21), done. remote: Compressing objects: 100% (19/19), done. remote: Total 21 (delta 4), reused 0 (delta 0), pack-reused 0 Receiving objects: 100% (21/21), done. Resolving deltas: 100% (4/4), done. переходим в Nick@S340 MINGW64 ~/Desktop/lab2/bob $ cd cs-lab02 настраиваем репозиторий Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git config user.name 'Bob (VasilyevIN)' Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git config user.email 'VasilyevIN@mpei.ru' 17. добавляем произведение в код и коммитим Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git add main.cpp Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git commit -m 'code: добавлено произведение' [main 820a211] code: добавлено произведение 1 file changed, 1 insertion(+) проверяем что от имени боба commit 820a21186b7fb0994f2bfc5715daaadb65f343d4 (HEAD -> main) Author: Bob (VasilyevIN) Date: Mon Apr 8 00:51:48 2024 +0300 code: добавлено произведение commit 3e832ad7767870fcec637db95a86cd83d182d45a (origin/main, origin/HEAD) Author: Alice (VasilyevIN) Date: Mon Mar 25 01:02:36 2024 +0300 code: добавили над мейном случайный текст commit 549e8c16a8e03f2da0f595d9ee8de068f3235e71 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:20:10 2024 +0300 git: добавлены игнорируемые файлы commit c44ebb879a22a19577579c4ebb362595153f2350 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:03:10 2024 +0300 code: добавили разность commit a50576165f0b064e31ce05382fe1f24761483ad1 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:58:38 2024 +0300 code: заготовка программы commit 82e72a4f5fd2cec49c679c2ff2aba53c24f13b3b Author: Alice (VasilyevIN) Date: Sun Mar 24 23:40:28 2024 +0300 Добавили ввод двух чисел в main() commit 07300fbcdcbb49e8f801c2bfc0ad845fc754bba4 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:32:52 2024 +0300 build: добавлен файл проекта commit a55d3e8a95d25d85c5d904a93319b57ba6c4f16e Author: Alice (VasilyevIN) Date: Sun Mar 24 23:28:58 2024 +0300 code: заготовка программы все верно 18. пушим коммит Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git push Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 417 bytes | 417.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 uit.mpei.ru:VasilyevIN/cs-lab02.git 3e832ad..820a211 main -> main 19. алиса получает Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git fetch Enter passphrase for key '/c/Users/Nick/.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), 397 bytes | 12.00 KiB/s, done. From uit.mpei.ru:VasilyevIN/cs-lab02 3e832ad..820a211 main -> origin/main проверяем историю Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git log --oneline --decorate --all --graph * 820a211 (origin/main) code: добавлено произведение * 3e832ad (HEAD -> main) code: добавили над мейном случайный текст * 549e8c1 git: добавлены игнорируемые файлы * c44ebb8 code: добавили разность * a505761 code: заготовка программы * 82e72a4 Добавили ввод двух чисел в main() * 07300fb build: добавлен файл проекта * a55d3e8 code: заготовка программы передвигаем Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git pull --ff-only Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Updating 3e832ad..820a211 Fast-forward main.cpp | 1 + 1 file changed, 1 insertion(+) 20. добавляем алисой деление и пушим Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git push Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 404 bytes | 404.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 uit.mpei.ru:VasilyevIN/cs-lab02.git 820a211..efced35 main -> main 21. боб получаеи Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git fetch Enter passphrase for key '/c/Users/Nick/.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), 384 bytes | 8.00 KiB/s, done. From uit.mpei.ru:VasilyevIN/cs-lab02 820a211..efced35 main -> origin/main Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git pull --ff-only Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Updating 820a211..efced35 Fast-forward main.cpp | 1 + 1 file changed, 1 insertion(+) 22. алиса добавляет макс и пушит Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git add main.cpp Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git commit -m 'code: добавили максимум' [main 1893aff] code: добавили максимум 1 file changed, 5 insertions(+) Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git push Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 417 bytes | 417.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 uit.mpei.ru:VasilyevIN/cs-lab02.git efced35..1893aff main -> main 23. боб добавляет мин и пытается в пуш Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git add main.cpp Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git commit -m 'code: добавл мин' [main cd2af85] code: добавл мин 1 file changed, 5 insertions(+) Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git push Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': To uit.mpei.ru:VasilyevIN/cs-lab02.git ! [rejected] main -> main (fetch first) error: failed to push some refs to 'uit.mpei.ru:VasilyevIN/cs-lab02.git' hint: Updates were rejected because the remote contains work that you do not hint: have locally. This is usually caused by another repository pushing to hint: the same ref. If you want to integrate the remote changes, use hint: 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 24. загружаем с серва и лог Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git fetch Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enter passphrase for key '/c/Users/Nick/.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), 397 bytes | 6.00 KiB/s, done. From uit.mpei.ru:VasilyevIN/cs-lab02 efced35..1893aff main -> origin/main Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git log --oneline cd2af85 (HEAD -> main) code: добавл мин efced35 code:добавили деление 820a211 code: добавлено произведение 3e832ad code: добавили над мейном случайный текст 549e8c1 git: добавлены игнорируемые файлы c44ebb8 code: добавили разность a505761 code: заготовка программы 82e72a4 Добавили ввод двух чисел в main() 07300fb build: добавлен файл проекта a55d3e8 code: заготовка программы git rebase origin/main удаляем метки конфликта и git add main.cpp $ git rebase --continue Successfully rebased and updated refs/heads/main. Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main|REBASE 1/1) $ git log commit 0c70a0379a9c62bb934e8be69864d4e11d5e19b4 (HEAD) Author: Bob (VasilyevIN) Date: Mon Apr 8 01:17:35 2024 +0300 code: добавл мин commit 1893afff50199e4dc241c9df387ba84dd602a3db (origin/main, origin/HEAD) Author: Alice (VasilyevIN) Date: Mon Apr 8 01:12:54 2024 +0300 code: добавили максимум commit efced3550f5502d07024fc8e575b0be95443c5a6 Author: Alice (VasilyevIN) Date: Mon Apr 8 01:03:46 2024 +0300 code:добавили деление commit 820a21186b7fb0994f2bfc5715daaadb65f343d4 Author: Bob (VasilyevIN) Date: Mon Apr 8 00:51:48 2024 +0300 code: добавлено произведение commit 3e832ad7767870fcec637db95a86cd83d182d45a Author: Alice (VasilyevIN) Date: Mon Mar 25 01:02:36 2024 +0300 code: добавили над мейном случайный текст commit 549e8c16a8e03f2da0f595d9ee8de068f3235e71 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:20:10 2024 +0300 git: добавлены игнорируемые файлы commit c44ebb879a22a19577579c4ebb362595153f2350 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:03:10 2024 +0300 code: добавили разность commit a50576165f0b064e31ce05382fe1f24761483ad1 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:58:38 2024 +0300 code: заготовка программы commit 82e72a4f5fd2cec49c679c2ff2aba53c24f13b3b Author: Alice (VasilyevIN) Date: Sun Mar 24 23:40:28 2024 +0300 Добавили ввод двух чисел в main() commit 07300fbcdcbb49e8f801c2bfc0ad845fc754bba4 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:32:52 2024 +0300 build: добавлен файл проекта commit a55d3e8a95d25d85c5d904a93319b57ba6c4f16e Author: Alice (VasilyevIN) Date: Sun Mar 24 23:28:58 2024 +0300 code: заготовка программы 25. пуш Nick@S340 MINGW64 ~/Desktop/lab2/bob/cs-lab02 (main) $ git push Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 4 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 (from 0) remote: . Processing 1 references remote: Processed 1 references in total To uit.mpei.ru:VasilyevIN/cs-lab02.git 1893aff..0c70a03 main -> main 26. алиса мутит с ветками и делает дабл и коммитит Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git branch double Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git checkout double Switched to branch 'double' Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (double) $ git add main.cpp Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (double) $ git commit -m 'code: замена на даьл' [double 9cde781] code: замена на даьл 1 file changed, 1 insertion(+), 1 deletion(-) Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (double) $ git checkout main Switched to branch 'main' Your branch is up to date with 'origin/main'. синхронизируем алису Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git fetch Enter passphrase for key '/c/Users/Nick/.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 | 9.00 KiB/s, done. From uit.mpei.ru:VasilyevIN/cs-lab02 1893aff..0c70a03 main -> origin/main сливаем Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git merge double Updating 1893aff..9cde781 Fast-forward main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) пушим git push Nick@S340 MINGW64 ~/Desktop/lab2/alice/project (main) $ git push Enter passphrase for key '/c/Users/Nick/.ssh/id_ed25519': To uit.mpei.ru:VasilyevIN/cs-lab02.git ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'uit.mpei.ru:VasilyevIN/cs-lab02.git' 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. commit 9cde7816cdc783e9b0aa140e941a9f753c945582 (HEAD -> main, double) Author: Alice (VasilyevIN) Date: Mon Apr 8 01:34:01 2024 +0300 code: замена на даьл commit 1893afff50199e4dc241c9df387ba84dd602a3db Author: Alice (VasilyevIN) Date: Mon Apr 8 01:12:54 2024 +0300 code: добавили максимум commit efced3550f5502d07024fc8e575b0be95443c5a6 Author: Alice (VasilyevIN) Date: Mon Apr 8 01:03:46 2024 +0300 code:добавили деление commit 820a21186b7fb0994f2bfc5715daaadb65f343d4 Author: Bob (VasilyevIN) Date: Mon Apr 8 00:51:48 2024 +0300 code: добавлено произведение commit 3e832ad7767870fcec637db95a86cd83d182d45a Author: Alice (VasilyevIN) Date: Mon Mar 25 01:02:36 2024 +0300 code: добавили над мейном случайный текст commit 549e8c16a8e03f2da0f595d9ee8de068f3235e71 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:20:10 2024 +0300 git: добавлены игнорируемые файлы commit c44ebb879a22a19577579c4ebb362595153f2350 Author: Alice (VasilyevIN) Date: Mon Mar 25 00:03:10 2024 +0300 code: добавили разность commit a50576165f0b064e31ce05382fe1f24761483ad1 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:58:38 2024 +0300 code: заготовка программы commit 82e72a4f5fd2cec49c679c2ff2aba53c24f13b3b Author: Alice (VasilyevIN) Date: Sun Mar 24 23:40:28 2024 +0300 Добавили ввод двух чисел в main() commit 07300fbcdcbb49e8f801c2bfc0ad845fc754bba4 Author: Alice (VasilyevIN) Date: Sun Mar 24 23:32:52 2024 +0300 build: добавлен файл проекта commit a55d3e8a95d25d85c5d904a93319b57ba6c4f16e Author: Alice (VasilyevIN) Date: Sun Mar 24 23:28:58 2024 +0300 code: заготовка программы