Skip to content

ДПИ22-2, Лабораторная работа 3, Шаповалов Виталий #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo "This is a backup script."
# This script is for backups.
1 change: 1 addition & 0 deletions file1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is file 1
1 change: 1 addition & 0 deletions file2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is file 2
74 changes: 74 additions & 0 deletions shapovalov-lab-1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
250 mkdir lab_1
251 cd lab_1
252 git init
253 git status
254 echo 'print("Hello world!")' > main.py
255 git status
256 git add main.py
257 git status
258 git commit -m "Первый коммит: добавлен вывод Hello world"
259 git status
260 echo '
def process_text(text):
return text.lower()
' >> main.py
261 git status
262 git add main.py
263 git status
264 git commit -m "Добавлена функция process_text для преобразования текста в нижний регистр"
265 git status
266 echo '
if __name__ == "__main__":
user_input = input("Введите текст: ")
print(process_text(user_input))
' >> main.py
267 git status
268 git add main.py
269 git commit -m "Добавлен ввод текста пользователя для функции process_text"
270 git status
271 git log
272 echo 'print("Программа завершена")' >> main.py
273 git commit -am "Добавлено сообщение о завершении программы"
274 git status
275 git log
276 echo 'def count_words(text): return len(text.split())' > utils.py
277 echo '# Instructions for using the program' > README.md
278 git status
279 git add .
280 git status
281 git commit -m "Добавлены utils.py и README.md"
282 python3 -m venv venv-lab-1
283 git status
284 echo "venv/" > .gitignore
285 git status
286 echo "venv-lab-1" > .gitignore
287 git status
288 git add .gitignore
289 git status
290 git commit -m "Добавлен файл .gitignore для исключения служебных файлов"
291 git branch feature/text-parsing
292 git checkout feature/text-parsing
293 git branch
294 git checkout main
295 git checkout master
296 git branch
297 echo "Основные инструкции для программы" >> README.md
298 git commit -am "Добавлены основные инструкции в README.md"
299 git status
300 git checkout feature/text-parsing
301 echo '
def parse_text(text):
return {"words": text.split(), "count": len(text.split())}
' >> utils.py
302 git commit -am "Добавлена функция parse_text для анализа текста"
303 git status
304 git checkout main
305 git checkout master
306 git merge feature/text-parsing
307 git status
308 git tag -a v1.0 -m "Релиз версии 1.0: стабильная версия программы"
309 git tag
310 history > $USER.txt
311 rm shap.txt
312 cd
313 history > $USER.txt
55 changes: 55 additions & 0 deletions shapovalov-lab-3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
373 mkdir -p ~/git/test
374 cd ~/git/test
375 git clone https://github.com/one-point-zero/Lab-3.git .
376 ls
377 echo '#!/bin/bash' > backup.sh
378 echo 'echo "This is a backup script."' >> backup.sh
379 chmod +x backup.sh
380 git status
381 git add backup.sh
382 git status
383 git commit -m "Добавлен скрипт backup.sh"
384 git status
385 git remote set-url origin [email protected]:one-point-zero/Lab-3.git
386 git push
387 git push -u origin master
388 ssh-keygen
389 cp ~/.ssh/id_rsa.pub .
390 ls
391 rm id_rsa.pub
392 cd
393 cp ~/.ssh/id_rsa.pub .
394 ls
395 cd git/test
396 git remote add origin [email protected]:one-point-zero/Lab-3.git
397 git remote set-url origin [email protected]:one-point-zero/Lab-3.git
398 git push origin master
399 git config --list
400 git push origin master
401 nano backup.sh
402 git status
403 git commit -am "Добавлен комментарий в backup.sh"
404 git status
405 nano backup.sh
406 git status
407 git commit -am "Добавлена синтаксическая ошибка в скрипт"
408 git status
409 git log
410 git reset --hard 1cdbc2aa4b4000649f5e3f2cd9487e428cb7caf2
411 git log
412 echo "This is file 1" > file1.txt
413 git commit -am "Добавлен файл file1.txt"
414 git reset --hard 1cdbc2aa4b4000649f5e3f2cd9487e428cb7caf2
415 git log
416 echo "This is file 1" > file1.txt
417 git status
418 git add file1.txt
419 git status
420 git commit -m "Добавлен файл file1.txt"
421 git status
422 echo "This is file 2" > file2.txt
423 git add file2.txt
424 git commit -m "Добавлен файл file2.txt"
425 git log
426 git push origin master
427 history > lab_3.txt
Binary file added Лабораторная работа 2.docx
Binary file not shown.