Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

164 строки
6.3 KiB
Plaintext

German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02
$ mkdir project
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02
$ cd project
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project
$ git init
Initialized empty Git repository in C:/Users/German/Desktop/Защита lab02/project/.git/
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git config user.name "LatyshevGI"
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git config user.email "LatyshevGI@mpei.ru"
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ touch letters.txt
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git add letters.txt
g
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git commit -m "file: добавлены строки a, b и c"
[master (root-commit) 259079c] file: добавлены строки a, b и c
1 file changed, 3 insertions(+)
create mode 100644 letters.txt
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git commit -a -m 'file: удалена строка c и добавлены d, e, f'
[master c247d00] file: удалена строка c и добавлены d, e, f
1 file changed, 3 insertions(+), 1 deletion(-)
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git show HEAD
commit c247d00cc405ccac7aa252aa04182a6cb41ff352 (HEAD -> master)
Author: LatyshevGI <LatyshevGI@mpei.ru>
Date: Fri Apr 4 11:25:37 2025 +0300
file: удалена строка c и добавлены d, e, f
diff --git a/letters.txt b/letters.txt
index 1c943a9..e62abb9 100644
--- a/letters.txt
+++ b/letters.txt
@@ -1,3 +1,5 @@
a
b
-c
\ No newline at end of file
+d
+e
+f
\ No newline at end of file
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ touch README.md
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git init
Reinitialized existing Git repository in C:/Users/German/Desktop/Защита lab02/project/.git/
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git add README.md
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git commit -m 'first commit'
[master 51cb05c] first commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git remote add origin http://uit.mpei.ru/git/LatyshevGI/Project-lab02.git
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git push -u origin master
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 20 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (9/9), 775 bytes | 387.00 KiB/s, done.
Total 9 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://uit.mpei.ru/git/LatyshevGI/Project-lab02.git
* [new branch] master -> master
branch 'master' set up to track 'origin/master'.
______Новая "машина":
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue
$ git clone http://uit.mpei.ru/git/LatyshevGI/Project-lab02.git project
Cloning into 'project'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (9/9), done.
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue
$ cd project
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue/project (master)
$ git init
Reinitialized existing Git repository in C:/Users/German/Desktop/Защита lab02/catalogue/project/.git/
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue/project (master)
$ git config user.name 'LatyshevGI'
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue/project (master)
$ git config user.email 'LatyshevGI@mpei.ru'
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue/project (master)
$ git commit -a -m 'file: добавлены строки g и h'
[master 648d5ac] file: добавлены строки g и h
1 file changed, 3 insertions(+), 1 deletion(-)
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/catalogue/project (master)
$ git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 20 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 331 bytes | 331.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: . Processing 1 references
remote: Processed 1 references in total
To http://uit.mpei.ru/git/LatyshevGI/Project-lab02.git
51cb05c..648d5ac master -> master
______Исходная "машина":
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git fetch
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 311 bytes | 15.00 KiB/s, done.
From http://uit.mpei.ru/git/LatyshevGI/Project-lab02
51cb05c..648d5ac master -> origin/master
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git log --oneline --decorate --all --graph
* 648d5ac (origin/master, origin/HEAD) file: добавлены строки g и h
* 51cb05c (HEAD -> master) first commit
* c247d00 file: удалена строка c и добавлены d, e, f
* 259079c file: добавлены строки a, b и c
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git pull --ff-only
Updating 51cb05c..648d5ac
Fast-forward
letters.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
German@DESKTOP-VOTQ4U6 MINGW64 ~/Desktop/Защита lab02/project (master)
$ git log --oneline --decorate --all --graph
* 648d5ac (HEAD -> master, origin/master, origin/HEAD) file: добавлены строки g и h
* 51cb05c first commit
* c247d00 file: удалена строка c и добавлены d, e, f
* 259079c file: добавлены строки a, b и c