Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
|
1 год назад | |
---|---|---|
.gitignore | 1 год назад | |
README.txt | 1 год назад | |
main2.cpp | 1 год назад | |
project.cbp | 1 год назад |
README.txt
Отчет по лабораторной работе №2 “Система контроля версий Git”
Выполнил: Антонов Д.А.
Группа: А-03-23
Проверил: Козлюк Д.А.
Примечание: работа выполнялась на OS X.
1. Cоздал на рабочем столе каталог lab02 и запустил в нем Git Bash
dmitrijantonov@MacBook-Air-Dmitrij ~ % cd desktop
dmitrijantonov@MacBook-Air-Dmitrij desktop % cd lab02
2. Просмотрел файлы в рабочем каталоге можно командой “ls” – пусто:
dmitrijantonov@MacBook-Air-Dmitrij lab02 % ls
3.Создал каталоги Алисы и Боба, создал каталог “project”,изучил команду “cd” в процессе:
dmitrijantonov@MacBook-Air-Dmitrij lab02 % mkdir alice
dmitrijantonov@MacBook-Air-Dmitrij lab02 % mkdir bob
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd alice
dmitrijantonov@MacBook-Air-Dmitrij alice % mkdir project
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
4.Инициализировал репозитарий:
dmitrijantonov@MacBook-Air-Dmitrij project % git init
Initialized empty Git repository in /Users/dmitrijantonov/Desktop/lab02/alice/project/.git/
5. Смотрю имя ветки git. По умолчанию git создал ветку под названием main
dmitrijantonov@MacBook-Air-Dmitrij project % git status
On branch main
6. Посмотрл папку, где git хранит свою данные
dmitrijantonov@MacBook-Air-Dmitrij project % ls -A
.git
7. Настроил репозитарий Алисы, чтобы коммиты были от ее имени:
dmitrijantonov@MacBook-Air-Dmitrij project % git config user.name 'Alice (AntonovDA)'
dmitrijantonov@MacBook-Air-Dmitrij project % git config user.email 'AntonovDAn@mpei.ru'
8. Заносим под git файл main2.cpp (набор изменений, который войдет в коммит)
dmitrijantonov@MacBook-Air-Dmitrij project % git add main2.cpp
9. Проверил Состояние репозитория ( появился отслеживаемый файл )
dmitrijantonov@MacBook-Air-Dmitrij project % git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: main2.cpp
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
main2
main2.dSYM/
10. Выполнил коммит с файлом main2.cpp и коротким сообщением
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m 'code: заготовка программы'
[main (root-commit) 9896924] code: заготовка программы
1 file changed, 9 insertions(+)
create mode 100644 main2.cpp
dmitrijantonov@MacBook-Air-Dmitrij project % git add project.cbp
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m 'build: add projecct file'
[main bad78bc] build: add projecct file
1 file changed, 9 insertions(+)
create mode 100644 project.cbp
11. Сделал изменения в main2.cpp. Когда добавлялся новый файл, он помечался как: new file: main2.cpp. А измененный - modified: main2.cpp
dmitrijantonov@MacBook-Air-Dmitrij project % git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: main2.cpp
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
main2
main2.dSYM/
no changes added to commit (use "git add" and/or "git commit -a")
12 а). 1 способ сделать коммит: сначала выбрать файлы, потом коммит
dmitrijantonov@MacBook-Air-Dmitrij project % git add main2.cpp
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "..."
[main 9f6cd71] ...
1 file changed, 3 insertions(+), 3 deletions(-)
12 б). 2 способ добавить в индекс, затем сделать коммит
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "..."
[main 6d4ba94] ...
1 file changed, 4 insertions(+)
12 в). 3 способ Добавить все изменения в индекс и сделать коммит в один шаг
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -a -m "code: add sum of a,b"
[main 051a5a1] code: add sum of a,b
1 file changed, 3 insertions(+), 1 deletion(-)
13. Добавляю игнорируемые файлы.
dmitrijantonov@MacBook-Air-Dmitrij project % git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
.gitignore
main2
main2.dSYM/
nothing added to commit but untracked files present (use "git add" to track)
dmitrijantonov@MacBook-Air-Dmitrij project % git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
.gitignore
main2
main2.dSYM/
nothing added to commit but untracked files present (use "git add" to track)
dmitrijantonov@MacBook-Air-Dmitrij project % ls
main2 main2.cpp main2.dSYM project.cbp
dmitrijantonov@MacBook-Air-Dmitrij project % ls -A
.DS_Store .gitignore main2.cpp project.cbp
.git main2 main2.dSYM
14. Коммит .gitignore
dmitrijantonov@MacBook-Air-Dmitrij project % git add .gitignore
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m 'git: ignoreted files'
[main ae9e215] git: ignoreted files
1 file changed, 1 insertion(+)
create mode 100644 .gitignore
15. Просмотр истории
dmitrijantonov@MacBook-Air-Dmitrij project % git log
commit ae9e215dfc2d2d4b7293756374f86a6a98d96f85 (HEAD -> main)
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 15:11:41 2024 +0300
git: ignoreted files
commit 051a5a1ec2613fa76bdebad3c00859fe09a98a30
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:57:23 2024 +0300
code: add sum of a,b
commit 6d4ba94206e098876de23f7957beb100a3bb1a41
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:50:50 2024 +0300
...
commit 9f6cd71ea75501bc4bd6456090797c24484cac6a
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:49:31 2024 +0300
...
15 б) файлы, измененные в коммитах
dmitrijantonov@MacBook-Air-Dmitrij project % git log --stat
commit ae9e215dfc2d2d4b7293756374f86a6a98d96f85 (HEAD -> main)
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 15:11:41 2024 +0300
git: ignoreted files
.gitignore | 1 +
1 file changed, 1 insertion(+)
commit 051a5a1ec2613fa76bdebad3c00859fe09a98a30
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:57:23 2024 +0300
code: add sum of a,b
main2.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
commit 6d4ba94206e098876de23f7957beb100a3bb1a41
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:50:50 2024 +0300
...
15 в). Показать коммиты компактно –graph в виде дерева
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate
ae9e215 (HEAD -> main) git: ignoreted files
051a5a1 code: add sum of a,b
6d4ba94 ...
9f6cd71 ...
bad78bc build: add projecct file
9896924 code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* ae9e215 (HEAD -> main) git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
15 г). Коммит затрагивающие main2.cpp
dmitrijantonov@MacBook-Air-Dmitrij project % git log -- main2.cpp
commit 051a5a1ec2613fa76bdebad3c00859fe09a98a30
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:57:23 2024 +0300
code: add sum of a,b
commit 6d4ba94206e098876de23f7957beb100a3bb1a41
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:50:50 2024 +0300
...
commit 9f6cd71ea75501bc4bd6456090797c24484cac6a
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:49:31 2024 +0300
...
commit 9896924a35ca5fdd52939beef46d8e0a885b0993
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:44:52 2024 +0300
code: заготовка программы
15 д) Коммиты , затрагивающие тему code
dmitrijantonov@MacBook-Air-Dmitrij project % git log --grep "code:"
commit 051a5a1ec2613fa76bdebad3c00859fe09a98a30
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:57:23 2024 +0300
code: add sum of a,b
commit 9896924a35ca5fdd52939beef46d8e0a885b0993
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:44:52 2024 +0300
code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git log --grep "build:"
commit bad78bcf10ad96e53ec091c998e9e9c7957d725b
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:47:54 2024 +0300
build: add projecct file
dmitrijantonov@MacBook-Air-Dmitrij project % git log -- project.cbp
commit bad78bcf10ad96e53ec091c998e9e9c7957d725b
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:47:54 2024 +0300
build: add projecct file
16 а). Посмотреть текущий коммит( по имени ветви)
dmitrijantonov@MacBook-Air-Dmitrij project % git show main
commit ae9e215dfc2d2d4b7293756374f86a6a98d96f85 (HEAD -> main)
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 15:11:41 2024 +0300
git: ignoreted files
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5a12c2a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.exe
\ No newline at end of file
16 б). Посмотреть текущий коммит
dmitrijantonov@MacBook-Air-Dmitrij project % git show HEAD
commit ae9e215dfc2d2d4b7293756374f86a6a98d96f85 (HEAD -> main)
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 15:11:41 2024 +0300
git: ignoreted files
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5a12c2a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.exe
\ No newline at end of file
16 в). По хэшу нужного коммита.
dmitrijantonov@MacBook-Air-Dmitrij project % git show 5a12c2a
.exe
16 г). Просмотр предудыщего коммита.
dmitrijantonov@MacBook-Air-Dmitrij project % git show HEAD~1
commit 051a5a1ec2613fa76bdebad3c00859fe09a98a30
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:57:23 2024 +0300
code: add sum of a,b
diff --git a/main2.cpp b/main2.cpp
index 9e875c9..0400acb 100644
--- a/main2.cpp
+++ b/main2.cpp
@@ -6,7 +6,9 @@ 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;
dmitrijantonov@MacBook-Air-Dmitrij project % git show main~1
commit 051a5a1ec2613fa76bdebad3c00859fe09a98a30
Author: Alice (AntonovDA) <AntonovDAn@mpei.ru>
Date: Sun Mar 24 14:57:23 2024 +0300
code: add sum of a,b
diff --git a/main2.cpp b/main2.cpp
index 9e875c9..0400acb 100644
--- a/main2.cpp
+++ b/main2.cpp
@@ -6,7 +6,9 @@ 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;
17). Просмотр изменений рабочей копии.
dmitrijantonov@MacBook-Air-Dmitrij project % git diff
diff --git a/.gitignore b/.gitignore
index 5a12c2a..a0a0033 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-.exe
\ No newline at end of file
+.exe
+.dSYM/
\ No newline at end of file
diff --git a/main2.cpp b/main2.cpp
index 0400acb..987e7c5 100644
--- a/main2.cpp
+++ b/main2.cpp
@@ -7,7 +7,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 ;
17 б). от указанного до последнего, + изменения рабочей копии
dmitrijantonov@MacBook-Air-Dmitrij project % git diff HEAD~2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a0a0033
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.exe
+.dSYM/
\ No newline at end of file
diff --git a/main2.cpp b/main2.cpp
index 9e875c9..987e7c5 100644
--- a/main2.cpp
+++ b/main2.cpp
@@ -6,7 +6,10 @@ 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'
+ << "A * B = " << a * b ;
+
18). Коммит изменений.
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -a -m "code: cout product'
dquote> "
[main 294564d] code: cout product'
2 files changed, 4 insertions(+), 2 deletions(-)
19) Откат изменений к предудыщему коммиту. HEAD~1 указ. На коммит, --hard приводит рабочую копию к нужному состоянию.
dmitrijantonov@MacBook-Air-Dmitrij project % git reset --hard HEAD~1
HEAD is now at ae9e215 git: ignoreted files
19 а). Другой способ. Откат файла к состоянию последнего коммита (отдельный файл)
dmitrijantonov@MacBook-Air-Dmitrij project % git checkout HEAD -- main2.cpp
20) Создать пару ключей.
dmitrijantonov@MacBook-Air-Dmitrij project % ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/dmitrijantonov/.ssh/id_rsa):
/Users/dmitrijantonov/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/dmitrijantonov/.ssh/id_rsa
Your public key has been saved in /Users/dmitrijantonov/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:D8bRn2Has25uBbojMbkCu5fgl+WVthPH8MCh65P6+OI dmitrijantonov@MacBook-Air-Dmitrij.local
The key's randomart image is:
+---[RSA 3072]----+
| |
| .. |
| .o..o |
| ...+=.o |
| So.B=. |
| o .*o* +o. |
| . + * B.=.. |
| o B.B =.o |
| .=E*oo *o |
+----[SHA256]-----+
21) Программа агент работает на фоне и предоставляют ключи.
dmitrijantonov@MacBook-Air-Dmitrij project % eval $(ssh-agent -s)
Agent pid 11202
22) Загрузить ключ
dmitrijantonov@MacBook-Air-Dmitrij project % ssh-add
Enter passphrase for /Users/dmitrijantonov/.ssh/id_rsa:
Identity added: /Users/dmitrijantonov/.ssh/id_rsa (dmitrijantonov@MacBook-Air-Dmitrij.local)
23) Отобразить открытый ключ
dmitrijantonov@MacBook-Air-Dmitrij project % cat ~/.ssh/id_rsa.pub
ssh-rsa
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDPxaVsyW3e2l1H9OeKsLDbnwAMsXdoHZKT/oCkQz2Y6l731yNQFqY5SO6FShPGPrXNDj5EpoNmb2XWK+dksaWsTNQOmkXbIlk8ld08jJdAFPpgm+IOEYT/mTGjzB912bkQnhvZrTIuYM7b33Y2VPdVLEK/W4hu1jZiHRZqGzdS0yX2pZFiDjso5jDHYXZNMMkjeGeWCo3dHEH176qJW2zxEiv47yvNJDbvWpGxlfzGYK9hjBBa6wF/BhmlZUA+kBvySOQTNTQaoduEozSnWm+0nx6+7yYZnxjIQ6hkO2DiYCCdhb18TM1uWOp9Gt8j7/kV8EO/9H7BNWjvE30HjjojZj1pCaOIf9kQFMxaviYOZYBCAS6lq7Qe0M15rc7o20os6drIe0Lo1txaXnemxBKrlt1rXMu+4gMuSruQiYWQvxuiYwYBoQ/CNCrfK7pcwmHKAdRuRRD/99yWrArkcUSUhCvKN3ygEPjZLmvDY3cpf+0I0rYaX1JKM57GfIeNv0U= dmitrijantonov@MacBook-Air-Dmitrij.local
zsh: command not found: ssh-rsa
24) Отправка проекта на сервер
dmitrijantonov@MacBook-Air-Dmitrij project % git remote add origin git@uit.mpei.ru:AntonovDAn/cs-lab002.git
dmitrijantonov@MacBook-Air-Dmitrij project % git push -u origin main
ssh: connect to host uit.mpei.ru port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
25) меняю адрес SSH на HTTP
dmitrijantonov@MacBook-Air-Dmitrij project % git remote set-url origin http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
dmitrijantonov@MacBook-Air-Dmitrij project % git push -u origin main
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 4 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (17/17), 1.74 KiB | 445.00 KiB/s, done.
Total 17 (delta 2), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
26) Отображение адреса
dmitrijantonov@MacBook-Air-Dmitrij project % git remote -v
origin http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git (fetch)
origin http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git (push)
27) Просоединился Боб
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij alice % cd ..
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd bob
dmitrijantonov@MacBook-Air-Dmitrij bob % git clone http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git project
Cloning into 'project'...
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 17 (delta 2), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (17/17), done.
Resolving deltas: 100% (2/2), done.
dmitrijantonov@MacBook-Air-Dmitrij bob % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git config user.name 'Bob (AntonovDA)'
dmitrijantonov@MacBook-Air-Dmitrij project % git config user.email 'AntonovDAn@mpei.ru'
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m 'code: умножение'
On branch main
Your branch is up to date with 'origin/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: main2.cpp
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
no changes added to commit (use "git add" and/or "git commit -a")
dmitrijantonov@MacBook-Air-Dmitrij project % git diff
diff --git a/main2.cpp b/main2.cpp
index 0400acb..987e7c5 100644
--- a/main2.cpp
+++ b/main2.cpp
@@ -7,7 +7,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 ;
return 0;
dmitrijantonov@MacBook-Air-Dmitrij project % git diff HEAD~2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5a12c2a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.exe
\ No newline at end of file
diff --git a/main2.cpp b/main2.cpp
index 9e875c9..987e7c5 100644
--- a/main2.cpp
+++ b/main2.cpp
@@ -6,7 +6,10 @@ 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'
+ << "A * B = " << a * b ;
+
return 0;
28) Отправил коммит на сервер
dmitrijantonov@MacBook-Air-Dmitrij project % git push
Everything up-to-date
dmitrijantonov@MacBook-Air-Dmitrij project % ls
main2.cpp project.cbp
dmitrijantonov@MacBook-Air-Dmitrij project % cd..
zsh: command not found: cd..
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij bob % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git push
Everything up-to-date
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "code: умножение"
[main 1b53cb5] code: умножение
1 file changed, 2 insertions(+), 1 deletion(-)
dmitrijantonov@MacBook-Air-Dmitrij project % git push
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), 401 bytes | 401.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 http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
ae9e215..1b53cb5 main -> main
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij bob % cd ..
29) Загрузка изменений Алиса
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd alice
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 381 bytes | 127.00 KiB/s, done.
From http://uit.mpei.ru/git/AntonovDAn/cs-lab2
ae9e215..1b53cb5 main -> origin/main
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* 1b53cb5 (origin/main) code: умножение
* ae9e215 (HEAD -> main) git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
30) Продвинуть main к скаченной версии.
dmitrijantonov@MacBook-Air-Dmitrij project % git pull --ff-only
Updating ae9e215..1b53cb5
Fast-forward
main2.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "code: деление"
[main 7e0afec] code: деление
1 file changed, 2 insertions(+), 3 deletions(-)
dmitrijantonov@MacBook-Air-Dmitrij project % git push
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), 400 bytes | 400.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 http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
1b53cb5..7e0afec main -> main
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij alice % cd ..
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd bob
dmitrijantonov@MacBook-Air-Dmitrij bob % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 380 bytes | 76.00 KiB/s, done.
From http://uit.mpei.ru/git/AntonovDAn/cs-lab2
1b53cb5..7e0afec main -> origin/main
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* 7e0afec (origin/main, origin/HEAD) code: деление
* 1b53cb5 (HEAD -> main) code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git pull --ff-only
Updating 1b53cb5..7e0afec
Fast-forward
main2.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij bob % cd ..
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd alice
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "code: макс число"
[main 9f3601a] code: макс число
1 file changed, 8 insertions(+)
dmitrijantonov@MacBook-Air-Dmitrij project % git push
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), 447 bytes | 447.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 http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
7e0afec..9f3601a main -> main
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij alice % cd ..
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd bob
dmitrijantonov@MacBook-Air-Dmitrij bob % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "code: мин число"
[main eeecda7] code: мин число
1 file changed, 8 insertions(+)
31) Коммит боба основан не на последнем коммите
dmitrijantonov@MacBook-Air-Dmitrij project % git push
To http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'http://uit.mpei.ru/git/AntonovDAn/cs-lab2.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.
dmitrijantonov@MacBook-Air-Dmitrij project % git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 427 bytes | 85.00 KiB/s, done.
From http://uit.mpei.ru/git/AntonovDAn/cs-lab2
7e0afec..9f3601a main -> origin/main
32) Ветка разошлась
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* eeecda7 (HEAD -> main) code: мин число
| * 9f3601a (origin/main, origin/HEAD) code: макс число
|/
* 7e0afec code: деление
* 1b53cb5 code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
33) Коммит Боба поверх Алисы. Но у Алисы «старый код»
dmitrijantonov@MacBook-Air-Dmitrij project % git rebase origin/main
Auto-merging main2.cpp
CONFLICT (content): Merge conflict in main2.cpp
error: could not apply eeecda7... code: мин число
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply eeecda7... code: мин число
dmitrijantonov@MacBook-Air-Dmitrij project % git add main2.cpp
dmitrijantonov@MacBook-Air-Dmitrij project % git rebase --continue
hint: Waiting for your editor to close the file... error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.
error: could not commit staged changes.
dmitrijantonov@MacBook-Air-Dmitrij project % git rebase origin/main
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase. If that is the
case, please try
git rebase (--continue | --abort | --skip)
If that is not the case, please
rm -fr ".git/rebase-merge"
and run me again. I am stopping in case you still have something
valuable there.
dmitrijantonov@MacBook-Air-Dmitrij project % git rebase --skip
Successfully rebased and updated refs/heads/main.
34). История хранилища имеет желаемый вид
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* 9f3601a (HEAD -> main, origin/main, origin/HEAD) code: макс число
* 7e0afec code: деление
* 1b53cb5 code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -a -m "code: after rebase"
[main 571e6ae] code: after rebase
1 file changed, 8 insertions(+)
dmitrijantonov@MacBook-Air-Dmitrij project % git push
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), 389 bytes | 389.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 http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
9f3601a..571e6ae main -> main
35) Ветка double
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij bob % cd ..
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd alice
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git branch double
dmitrijantonov@MacBook-Air-Dmitrij project % git checkout double
M main2.cpp
Switched to branch 'double'
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "changes: int~double"
[double 3b6d97f] changes: int~double
1 file changed, 5 insertions(+), 4 deletions(-)
36) Синхронизация ветки Алисы с сервером.
dmitrijantonov@MacBook-Air-Dmitrij project % git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
dmitrijantonov@MacBook-Air-Dmitrij project % git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 369 bytes | 92.00 KiB/s, done.
From http://uit.mpei.ru/git/AntonovDAn/cs-lab2
9f3601a..571e6ae main -> origin/main
dmitrijantonov@MacBook-Air-Dmitrij project % git remote -v
origin http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git (fetch)
origin http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git (push)
dmitrijantonov@MacBook-Air-Dmitrij project % git clone http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git project
Cloning into 'project'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 29 (delta 6), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (29/29), done.
Resolving deltas: 100% (6/6), done.
dmitrijantonov@MacBook-Air-Dmitrij project % git fetch
37) Новая история
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* 3b6d97f (double) changes: int~double
| * 571e6ae (origin/main) code: after rebase
|/
* 9f3601a (HEAD -> main) code: макс число
* 7e0afec code: деление
* 1b53cb5 code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git pull --ff-only
Updating 9f3601a..571e6ae
Fast-forward
main2.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
38) Слияние веток
dmitrijantonov@MacBook-Air-Dmitrij project % git merge double
Auto-merging main2.cpp
CONFLICT (content): Merge conflict in main2.cpp
Automatic merge failed; fix conflicts and then commit the result.
dmitrijantonov@MacBook-Air-Dmitrij project % git merge double
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -a -m ".."
[main e95cd44] ..
dmitrijantonov@MacBook-Air-Dmitrij project % git checkout main
Switched to branch 'main'
Your branch is ahead of 'origin/main' by 2 commits.
(use "git push" to publish your local commits)
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* e95cd44 (HEAD -> main) ..
|\
| * 3b6d97f (double) changes: int~double
* | 571e6ae (origin/main) code: after rebase
|/
* 9f3601a code: макс число
* 7e0afec code: деление
* 1b53cb5 code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git push
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 698 bytes | 698.00 KiB/s, done.
Total 6 (delta 2), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
571e6ae..e95cd44 main -> main
dmitrijantonov@MacBook-Air-Dmitrij project % git add -u
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m "code: merge commit"
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
.DS_Store
main2
main2.dSYM/
project/
nothing added to commit but untracked files present (use "git add" to track)
dmitrijantonov@MacBook-Air-Dmitrij project % EDITOR=nano git merge double
Already up to date.
39) Добавление файл README
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd alice
dmitrijantonov@MacBook-Air-Dmitrij alice % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git add README.txt
dmitrijantonov@MacBook-Air-Dmitrij project % git commit -m 'report: отчет о работе'
[main e25e2ef] report: отчет о работе
1 file changed, 1573 insertions(+)
create mode 100644 README.txt
dmitrijantonov@MacBook-Air-Dmitrij project % git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 8.11 KiB | 4.05 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To http://uit.mpei.ru/git/AntonovDAn/cs-lab2.git
e95cd44..e25e2ef main -> main
dmitrijantonov@MacBook-Air-Dmitrij project % cd ..
dmitrijantonov@MacBook-Air-Dmitrij alice % cd ..
dmitrijantonov@MacBook-Air-Dmitrij lab02 % cd bob
dmitrijantonov@MacBook-Air-Dmitrij bob % cd project
dmitrijantonov@MacBook-Air-Dmitrij project % git fetch
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 9 (delta 3), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), 8.64 KiB | 737.00 KiB/s, done.
From http://uit.mpei.ru/git/AntonovDAn/cs-lab2
571e6ae..e25e2ef main -> origin/main
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* e25e2ef (origin/main, origin/HEAD) report: отчет о работе
* e95cd44 ..
|\
| * 3b6d97f changes: int~double
* | 571e6ae (HEAD -> main) code: after rebase
|/
* 9f3601a code: макс число
* 7e0afec code: деление
* 1b53cb5 code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы
dmitrijantonov@MacBook-Air-Dmitrij project % git pull --ff-only
Updating 571e6ae..e25e2ef
Fast-forward
README.txt | 1573 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
main2.cpp | 1 +
2 files changed, 1574 insertions(+)
create mode 100644 README.txt
dmitrijantonov@MacBook-Air-Dmitrij project % git log --oneline --decorate --all --graph
* e25e2ef (HEAD -> main, origin/main, origin/HEAD) report: отчет о работе
* e95cd44 ..
|\
| * 3b6d97f changes: int~double
* | 571e6ae code: after rebase
|/
* 9f3601a code: макс число
* 7e0afec code: деление
* 1b53cb5 code: умножение
* ae9e215 git: ignoreted files
* 051a5a1 code: add sum of a,b
* 6d4ba94 ...
* 9f6cd71 ...
* bad78bc build: add projecct file
* 9896924 code: заготовка программы .