add: добавление отчета

master
Alice (BiriukovaAlS) 2 лет назад
Родитель 8282d125c1
Сommit bb9fc7e897

@ -0,0 +1,802 @@
Отчет по лабораторной работе №2 "Система контроля версий Git"
Выполнила: Бирюкова А.С.
Группа: А-02-22
Проверил: Козлюк Д.А.
Примечание: работа выполнялась на Windows.
1. Создалa на рабочем столе каталог lab02 и запустила в нем Git Bash, приглашение:
Professional@User-PC MINGW64 ~/Desktop/lab02
$
2. Просмотрела файлы в рабочем каталоге командой ls - пусто:
Professional@User-PC MINGW64 ~/Desktop/lab02
$ ls
Professional@User-PC MINGW64 ~/Desktop/lab02
$
3. Создала каталоги Алисы и Боба, создала каталог project, изучила команду сd в процессе:
Professional@User-PC MINGW64 ~/Desktop/lab02
$ mkdir alice
Professional@User-PC MINGW64 ~/Desktop/lab02
$ mkdir bob
Professional@User-PC MINGW64 ~/Desktop/lab02
$ cd alice
Professional@User-PC MINGW64 ~/Desktop/lab02/alice
$ mkdir project
Professional@User-PC MINGW64 ~/Desktop/lab02/alice
$ cd project
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project
$ cd ..
Professional@User-PC MINGW64 ~/Desktop/lab02/alice
$ cd project
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project
$
4. Инициализировала репозитарий, изменила имя ветки, настроила Git:
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project
$ git init
Initialized empty Git repository in C:/Users/Professional/Desktop/lab02/alice/project/.git/
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (master)
$ git branch -m main
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ ls -A
.git/
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git config user.name 'Alice (BiriukovaAlS)'
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git config user.email 'BiriukovaAlS@mail.ru'
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
5. Создание коммитов.
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git status
On branch main //расположение на ветке 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) //коммиты не были добавлены, но есть файлы, которые можно сделать отслеживаемыми
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git status
On branch main
No commits yet
Changes to be committed: //были внесены изменения, теперь отслеживается файл main
(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
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m 'code: заготовка программы'
[main (root-commit) f221fcf] code: заготовка программы
1 file changed, 9 insertions(+)
create mode 100644 main.cpp
Professional@User-PC 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
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m 'build: добавлен файл проекта'
[main 52172e8] build: добавлен файл проекта
1 file changed, 38 insertions(+)
create mode 100644 project.cbp
5.1 Создание коммитов с изменениями
Professional@User-PC 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/
no changes added to commit (use "git add" and/or "git commit -a")
Появились коммиты, пропала строчка No commits yet, изменился статус main c new file на modified
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m "calc:добавление суммы"
[main 948d41a] calc:добавление суммы
1 file changed, 5 insertions(+), 1 deletion(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add -u
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m "calc:добавление разности"
[main 5687711] calc:добавление разности
1 file changed, 2 insertions(+), 1 deletion(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
6. Игнорирование файлов
Cоздала в CodeBlocks новый файл, сохранив его под именем .gitignore
Professional@User-PC MINGW64 ~/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/
nothing added to commit but untracked files present (use "git add" to track)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add .gitignore
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m "git:игнорирование файлов"
[main 17067fe] git:игнорирование файлов
1 file changed, 1 insertion(+)
create mode 100644 .gitignore
Professional@User-PC 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: .gitignore
no changes added to commit (use "git add" and/or "git commit -a")
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
7. Просмотр истории
7.1
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log
commit 17067fea00ee11c0f5d03d72396983cf10510ae6 (HEAD -> main)
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 19:02:58 2023 +0300
git:игнорирование файлов
commit 5687711c2093c7f43ad1511f087544870c41ccde
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:51:35 2023 +0300
calc:добавление разности
commit 948d41a0b9f0fa0347886afe5b0ae61070be3983
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:49:50 2023 +0300
calc:добавление суммы
commit 52172e8d9e6ccacff530bbfc8f4b215c5b7621b7
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:05:23 2023 +0300
build: добавлен файл проекта
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log --stat
commit 17067fea00ee11c0f5d03d72396983cf10510ae6 (HEAD -> main)
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 19:02:58 2023 +0300
git:игнорирование файлов
.gitignore | 1 +
1 file changed, 1 insertion(+)
commit 5687711c2093c7f43ad1511f087544870c41ccde
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:51:35 2023 +0300
calc:добавление разности
main.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
commit 948d41a0b9f0fa0347886afe5b0ae61070be3983
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:49:50 2023 +0300
calc:добавление суммы
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log --oneline --decorate
17067fe (HEAD -> main) git:игнорирование файлов
5687711 calc:добавление разности
948d41a calc:добавление суммы
52172e8 build: добавлен файл проекта
f221fcf code: заготовка программы
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log --oneline --decorate --all --graph
* 17067fe (HEAD -> main) git:игнорирование файлов
* 5687711 calc:добавление разности
* 948d41a calc:добавление суммы
* 52172e8 build: добавлен файл проекта
* f221fcf code: заготовка программы
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
7.2 Фильтрация коммитов
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log --grep "build:"
commit 52172e8d9e6ccacff530bbfc8f4b215c5b7621b7
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:05:23 2023 +0300
build: добавлен файл проекта
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log -- project.cbp
commit 52172e8d9e6ccacff530bbfc8f4b215c5b7621b7
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:05:23 2023 +0300
build: добавлен файл проекта
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
7.3 Просмотр коммитов
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git show 5687711
commit 5687711c2093c7f43ad1511f087544870c41ccde
Author: Alice (BiriukovaAlS) <BiriukovaAlS@mail.ru>
Date: Sun Mar 26 18:51:35 2023 +0300
calc:добавление разности
diff --git a/main.cpp b/main.cpp
index a1650de..4fa62fa 100644
--- a/main.cpp
+++ b/main.cpp
@@ -7,7 +7,8 @@ int main()
cout << "Enter A and B: ";
int a,b;
cin >> a >>b;
- cout << "A + B = " << a + b << '\n';
+ cout << "A + B = " << a + b << '\n'
+ << "A - B = " << a - b << '\n';
return 0;
}
7.4 Просмотр изменений
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git diff
diff --git a/.gitignore b/.gitignore //новая и старая версии файла
index 5e56e04..d85abef 100644 //первые два - хэши сравниваемых файлов, 100644 - внутренний идентификатор файла
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
/bin
+/obj
+/*.layout
diff --git a/main.cpp b/main.cpp
index 4fa62fa..2493819 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,7 +8,8 @@ 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;
}
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
Изменения между самым первым коммитом и коммитом, добавляющим вывод разности
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git diff HEAD~4 HEAD~1
diff --git a/main.cpp b/main.cpp
index b4392ec..4fa62fa 100644
--- a/main.cpp
+++ b/main.cpp
@@ -4,6 +4,11 @@ using namespace std;
int main()
{
- cout << "Hello world!" << endl;
+ cout << "Enter A and B: ";
+ int a,b;
+ cin >> a >>b;
+ cout << "A + B = " << a + b << '\n'
+ << "A - B = " << a - b << '\n';
+
return 0;
}
diff --git a/project.cbp b/project.cbp
new file mode 100644
index 0000000..c4697a9
--- /dev/null
+++ b/project.cbp
@@ -0,0 +1,38 @@
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
8.Откат изменений
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m "Вывод произведения"
[main c8d6e5f] Вывод произведения
1 file changed, 2 insertions(+), 1 deletion(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git reset --hard HEAD~1
HEAD is now at 17067fe git:игнорирование файлов
Добавила над функцией main() комментарий.
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git checkout HEAD -- main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
9.Обмен кодом через удаленное хранилище
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Professional/.ssh/id_rsa):
Created directory '/c/Users/Professional/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Professional/.ssh/id_rsa
Your public key has been saved in /c/Users/Professional/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:TOLydqitHxOPr3f0cTK+xOxmyMO3ztNIZySHYgR18cc Professional@User-PC
The key's randomart image is:
+---[RSA 3072]----+
| .o. o. |
| .. . . |
| . .. .. E|
| . + o o o. |
| . o S. . + |
| o = .o= + |
| B o+ =+X |
| + =. *+O . |
| oo+o.. **+ |
+----[SHA256]-----+
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ eval $(ssh-agent -s)
Agent pid 514
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ ssh-add
Enter passphrase for /c/Users/Professional/.ssh/id_rsa:
Identity added: /c/Users/Professional/.ssh/id_rsa (Professional@User-PC)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ cat ~/.ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGxF9p9iOaz+UuqWddUHoGfDGI4eTEPG5/wcZyVp/VITDZctmzLtuRCCoUC1ojfHk3TKsDu5l6ShmSXC2PGJOqW41fzdl+8siR+q8k0viuoFqsRjjx895RqRGZh2ih1+NsOlfT4xbKXFI1BGECuDfVO6H890RAur67VyIeAvZN0/ci2pPfOkJbeHzGpylQF357YzLv6O9Xvrs6RTg25IN5Jb+BgpSTCr/4ww9vmSQNIGq96Pqetu9Nh++uDym0yUmCqWaIf5TfisJbskxMwZzfuEQbWSqPrV3ifvMJzKdzb4gibB/3UlAoUAnZKaGCe79t77zPkwQLqu2KPbAFvpcrmawdh9B1UvUaWbma2/M1rnVkfauH+KM6jK9emtfjvRmEBXIiWPogJ425Og40JtEq73RTphGjh3e905+OLDJeu7pR4OnHAFnaPMoG5LTejZT3K8KtBUdD2huSgEhsy46xHqpSHJd32RdFjcNDGe9FwpIKx3npun8fuVARZy8odIM= Professional@User-PC
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
9.1 Перенос данных на сервер
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git remote add origin git@uit.mpei.ru:BiriukovaAS/cs-lab02.git
error: remote origin already exists.
Professional@User-PC 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: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 8 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (15/15), 2.00 KiB | 513.00 KiB/s, done.
Total 15 (delta 1), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:BiriukovaAS/cs-lab02.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
10.Совместная работа
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git remote -v
origin git@uit.mpei.ru:BiriukovaAS/cs-lab02.git (fetch)
origin git@uit.mpei.ru:BiriukovaAS/cs-lab02.git (push)
Professional@User-PC MINGW64 ~/Desktop/lab02/bob
$ git clone git@uit.mpei.ru:BiriukovaAS/cs-lab02.git project
Cloning into 'project'...
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 15 (delta 1), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (15/15), done.
Resolving deltas: 100% (1/1), done.
Professional@User-PC MINGW64 ~/Desktop/lab02/bob
$ cd project
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git config user.name 'Bob (BiriukovaAS)'
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git config user.email 'BiriukovaAlS@mpei.ru'
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$
10.1 Без конфликтов правок
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git commit -m "calc: добавление произведения"
[main 3fad887] calc: добавление произведения
1 file changed, 2 insertions(+), 2 deletions(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git log
commit 3fad88770c4dbf6e90126c43bf520d233d1639a7 (HEAD -> main)
Author: Bob (BiriukovaAS) <BiriukovaAlS@mpei.ru>
Date: Sun Mar 26 21:23:21 2023 +0300
calc: добавление произведения
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git push
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 432 bytes | 432.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:BiriukovaAS/cs-lab02.git
17067fe..3fad887 main -> main
Professional@User-PC MINGW64 ~/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), 412 bytes | 51.00 KiB/s, done.
From uit.mpei.ru:BiriukovaAS/cs-lab02
17067fe..3fad887 main -> origin/main
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git log --oneline --decorate --all --graph
* 3fad887 (origin/main) calc: добавление произведения
* 17067fe (HEAD -> main) git:игнорирование файлов
* 5687711 calc:добавление разности
* 948d41a calc:добавление суммы
* 52172e8 build: добавлен файл проекта
* f221fcf code: заготовка программы
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git pull --ff-only
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
Updating 3fad887..e94ec14
Fast-forward
main.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$
10.2 Самостоятельно
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m "calc: добавление деления"
[main e94ec14] calc: добавление деления
3 files changed, 5 insertions(+), 1 deletion(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git push
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 489 bytes | 489.00 KiB/s, done.
Total 5 (delta 2), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:BiriukovaAS/cs-lab02.git
3fad887..e94ec14 main -> main
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git fetch
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), 469 bytes | 33.00 KiB/s, done.
From uit.mpei.ru:BiriukovaAS/cs-lab02
3fad887..e94ec14 main -> origin/main
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git log --oneline --decorate --all --graph
* e94ec14 (origin/main, origin/HEAD) calc: добавление деления
* 3fad887 (HEAD -> main) calc: добавление произведения
* 17067fe git:игнорирование файлов
* 5687711 calc:добавление разности
* 948d41a calc:добавление суммы
* 52172e8 build: добавлен файл проекта
* f221fcf code: заготовка программы
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git pull --ff-only
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
Updating 3fad887..e94ec14
Fast-forward
main.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$
11. Разрешение конфликтов
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git commit -m "extr: вывод максимума"
[main 726d0e1] extr: вывод максимума
1 file changed, 4 insertions(+)
Professional@User-PC MINGW64 ~/Desktop/lab02/alice/project (main)
$ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 424 bytes | 424.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:BiriukovaAS/cs-lab02.git
e94ec14..726d0e1 main -> main
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git add main.cpp
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git commit -m "calc: вывод минимума"
[main 39855da] calc: вывод минимума
1 file changed, 4 insertions(+)
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git push
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
To uit.mpei.ru:BiriukovaAS/cs-lab02.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'uit.mpei.ru:BiriukovaAS/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.
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git fetch
Enter passphrase for key '/c/Users/Professional/.ssh/id_rsa':
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), 404 bytes | 44.00 KiB/s, done.
From uit.mpei.ru:BiriukovaAS/cs-lab02
e94ec14..726d0e1 main -> origin/main
Professional@User-PC MINGW64 ~/Desktop/lab02/bob/project (main)
$ git log --oneline --decorate --all --graph
* 39855da (HEAD -> main) calc: вывод минимума
| * 726d0e1 (origin/main, origin/HEAD) calc: вывод максимума
|/
* e94ec14 calc: добавление деления
* 3fad887 calc: добавление произведения
* 17067fe git:игнорирование файлов
* 5687711 calc:добавление разности
* 948d41a calc:добавление суммы
* 52172e8 build: добавлен файл проекта
* f221fcf code: заготовка программы
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/bob/project (master)
$ git rebase origin/master
First, rewinding head to replay your work on top of it...
Applying: extr: вывод минимума
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 extr: вывод минимума
Resolve all conflicts manually, mark them as resolved with
"git add/rm ", 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"
.
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/bob/project (master|REBASE 1/1)
$ git add main.cpp
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/bob/project (master|REBASE 1/1)
$ git rebase --continue
Applying: extr: вывод минимума
12. Использование веток
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git branch double
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git checkout double
Switched to branch 'double'
M project.cbp
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (double)
$ git add main.cpp
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (double)
$ git commit -m "data: изменение типа"
[double ec22e32] data: изменение типа
1 file changed, 1 insertion(+), 1 deletion(-)
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (double)
$ git checkout master
Switched to branch 'master'
M project.cbp
Your branch is up to date with 'origin/master'.
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ 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 uit.mpei.ru:BiriukovaAS/cs-lab2
66d1580..2914f43 master -> origin/master
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git pull --ff-only
Updating 66d1580..2914f43
Fast-forward
main.cpp | 1 +
1 file changed, 1 insertion(+)
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git log --oneline --decorate --all --graph
* ec22e32 (double) data: изменение типа
| * 2914f43 (HEAD -> master, origin/master) extr: вывод минимума
|/
* 66d1580 extr: вывод максимума
* b1c0e71 calc: добавление деления
* 31721fc calc: добавление произведения
* 6af56f3 git:игнорирование файлов
* 0987b45 calc:добавление разности
* 061a032 calc:добавление суммы
* 7524444 build: добавлен файл проекта
* d6a0d45 code: заготовка программы
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git merge double
Auto-merging main.cpp
Merge made by the 'recursive' strategy.
main.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git add main.cpp
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git push
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 729 bytes | 182.00 KiB/s, done.
Total 6 (delta 2), reused 0 (delta 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To uit.mpei.ru:BiriukovaAS/cs-lab2.git
2914f43..8282d12 master -> master
u111-05@PROG-09 MINGW32 ~/Desktop/lab02/alice/project (master)
$ git log --oneline --decorate --all --graph
* 8282d12 (HEAD -> master, origin/master) Merge branch 'double'
|\
| * ec22e32 (double) data: изменение типа
* | 2914f43 extr: вывод минимума
|/
* 66d1580 extr: вывод максимума
* b1c0e71 calc: добавление деления
* 31721fc calc: добавление произведения
* 6af56f3 git:игнорирование файлов
* 0987b45 calc:добавление разности
* 061a032 calc:добавление суммы
* 7524444 build: добавлен файл проекта
* d6a0d45 code: заготовка программы
Загрузка…
Отмена
Сохранить