Last active
September 26, 2018 17:56
-
-
Save klimach/d2da03e33e8673d913fd3bf8eaa32082 to your computer and use it in GitHub Desktop.
Homework GIT (week1/lesson3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
taskt 1 | |
alexandr@klimach:~$ mkdir GitProjects | |
alexandr@klimach:~$ cd GitProjects | |
alexandr@klimach:~/GitProjects$ git init | |
Инициализирован пустой репозиторий Git в /home/alexandr/GitProjects/.git/ | |
alexandr@klimach:~/GitProjects$ subl file_0.txt | |
alexandr@klimach:~/GitProjects$ git add file_0.txt | |
alexandr@klimach:~/GitProjects$ git commit -m "New file" | |
[master (корневой коммит) 7e52681] New file | |
1 file changed, 1 insertion(+) | |
create mode 100644 file_0.txt | |
alexandr@klimach:~/GitProjects$ git branch feature/work_with_file | |
alexandr@klimach:~/GitProjects$ git branch | |
feature/work_with_file | |
* master | |
alexandr@klimach:~/GitProjects$ git checkout feature/work_with_file | |
Переключено на ветку «feature/work_with_file» | |
alexandr@klimach:~/GitProjects$ subl file_1.txt | |
alexandr@klimach:~/GitProjects$ git add file_1.py | |
alexandr@klimach:~/GitProjects$ git commit -m "Work with file" | |
[feature/work_with_file 155aabd] Work with file | |
1 file changed, 1 insertion(+) | |
create mode 100644 file_1.py | |
alexandr@klimach:~/GitProjects$ git remote add origin https://github.com/klimach/EducationRepository.git | |
alexandr@klimach:~/GitProjects$ git push | |
fatal: Текущая ветка feature/work_with_file не имеет вышестоящей ветки. | |
Чтобы отправить текущую ветку и установить внешнюю ветку как вышестоящую для этой ветки, используйте | |
git push --set-upstream origin feature/work_with_file | |
alexandr@klimach:~/GitProjects$ git push --set-upstream origin feature/work_with_file | |
Username for 'https://github.com': klimach | |
Password for 'https://[email protected]': | |
Перечисление объектов: 6, готово. | |
Подсчет объектов: 100% (6/6), готово. | |
При сжатии изменений используется до 4 потоков | |
Сжатие объектов: 100% (3/3), готово. | |
Запись объектов: 100% (6/6), 476 bytes | 238.00 KiB/s, готово. | |
Всего 6 (изменения 0), повторно использовано 0 (изменения 0) | |
remote: | |
remote: Create a pull request for 'feature/work_with_file' on GitHub by visiting: | |
remote: https://github.com/klimach/EducationRepository/pull/new/feature/work_with_file | |
remote: | |
To https://github.com/klimach/EducationRepository.git | |
* [new branch] feature/work_with_file -> feature/work_with_file | |
Ветка «feature/work_with_file» отслеживает внешнюю ветку «feature/work_with_file» из «origin». | |
alexandr@klimach:~/GitProjects$ | |
Task 2 | |
alexandr@klimach:~/GitProjects$ git branch task2/merge | |
alexandr@klimach:~/GitProjects$ git checkout task2/merge | |
Переключено на ветку «task2/merge» | |
alexandr@klimach:~/GitProjects$ subl file_1.py | |
alexandr@klimach:~/GitProjects$ git add file_1.py | |
alexandr@klimach:~/GitProjects$ git commit -m "New changes for file_1.py" | |
[task2/merge 8ca8429] New changes for file_1.py | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
alexandr@klimach:~/GitProjects$ git checkout feature/work_with_file | |
Переключено на ветку «feature/work_with_file» | |
Ваша ветка обновлена в соответствии с «origin/feature/work_with_file». | |
alexandr@klimach:~/GitProjects$ git merge task2/merge | |
Обновление 155aabd..8ca8429 | |
Fast-forward | |
file_1.py | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
alexandr@klimach:~/GitProjects$ git push | |
Username for 'https://github.com': klimach | |
Password for 'https://[email protected]': | |
Перечисление объектов: 5, готово. | |
Подсчет объектов: 100% (5/5), готово. | |
При сжатии изменений используется до 4 потоков | |
Сжатие объектов: 100% (2/2), готово. | |
Запись объектов: 100% (3/3), 286 bytes | 286.00 KiB/s, готово. | |
Всего 3 (изменения 0), повторно использовано 0 (изменения 0) | |
To https://github.com/klimach/EducationRepository.git | |
155aabd..8ca8429 feature/work_with_file -> feature/work_with_file | |
alexandr@klimach:~/GitProjects$ | |
Task 3 | |
alexandr@klimach:~/GitProjects$ subl file_1.py | |
alexandr@klimach:~/GitProjects$ git add file_1.py | |
alexandr@klimach:~/GitProjects$ git commit -m "New changes for file_1.py" | |
[feature/work_with_file c6762c5] New changes for file_1.py | |
1 file changed, 2 insertions(+), 1 deletion(-) | |
alexandr@klimach:~/GitProjects$ git pull | |
Автослияние file_1.py | |
КОНФЛИКТ (содержимое): Конфликт слияния в file_1.py | |
Не удалось провести автоматическое слияние; исправьте конфликты и сделайте коммит результата. | |
alexandr@klimach:~/GitProjects$ git push | |
Username for 'https://github.com': klimach | |
Password for 'https://[email protected]': | |
To https://github.com/klimach/EducationRepository.git | |
! [rejected] feature/work_with_file -> feature/work_with_file (non-fast-forward) | |
error: не удалось отправить некоторые ссылки в «https://github.com/klimach/EducationRepository.git» | |
подсказка: Обновления были отклонены, так как верхушка вашей текущей ветки | |
подсказка: позади ее внешней части. Заберите и слейте внешние изменения | |
подсказка: (например, с помощью «git pull …») перед повторной попыткой отправки | |
подсказка: изменений. | |
подсказка: Для дополнительной информации, смотрите «Note about fast-forwards» | |
подсказка: в «git push --help». | |
alexandr@klimach:~/GitProjects$ git push --force | |
Username for 'https://github.com': klimach | |
Password for 'https://[email protected]': | |
Перечисление объектов: 5, готово. | |
Подсчет объектов: 100% (5/5), готово. | |
При сжатии изменений используется до 4 потоков | |
Сжатие объектов: 100% (2/2), готово. | |
Запись объектов: 100% (3/3), 291 bytes | 291.00 KiB/s, готово. | |
Всего 3 (изменения 0), повторно использовано 0 (изменения 0) | |
To https://github.com/klimach/EducationRepository.git | |
+ ac81beb...c6762c5 feature/work_with_file -> feature/work_with_file (forced update) | |
alexandr@klimach:~/GitProjects$ | |
Task 4* | |
alexandr@klimach:~$ mkdir CloneRep | |
alexandr@klimach:~$ cd CloneRep | |
alexandr@klimach:~/CloneRep$ git clone https://github.com/cursor-education/Git-lesson.git | |
Клонирование в «Git-lesson»… | |
remote: Enumerating objects: 6, done. | |
remote: Counting objects: 100% (6/6), done. | |
remote: Compressing objects: 100% (4/4), done. | |
remote: Total 6 (delta 1), reused 2 (delta 0), pack-reused 0 | |
Распаковка объектов: 100% (6/6), готово. | |
alexandr@klimach:~/CloneRep$ ls | |
Git-lesson | |
alexandr@klimach:~/CloneRep$ cd Git-lesson | |
alexandr@klimach:~/CloneRep/Git-lesson$ git branch | |
* master | |
alexandr@klimach:~/CloneRep/Git-lesson$ git branch bugfix/klimach | |
alexandr@klimach:~/CloneRep/Git-lesson$ git checkout bugfix/klimach | |
Переключено на ветку «bugfix/klimach» | |
alexandr@klimach:~/CloneRep/Git-lesson$ ls | |
gcd.py | |
alexandr@klimach:~/CloneRep/Git-lesson$ subl gcd.py | |
alexandr@klimach:~/CloneRep/Git-lesson$ git remote -v | |
origin https://github.com/cursor-education/Git-lesson.git (fetch) | |
origin https://github.com/cursor-education/Git-lesson.git (push) | |
alexandr@klimach:~/CloneRep/Git-lesson$ git add gcd.py | |
alexandr@klimach:~/CloneRep/Git-lesson$ git commit -m "Bug fix" | |
[bugfix/klimach 1173c7d] Bug fix | |
1 file changed, 4 insertions(+), 4 deletions(-) | |
alexandr@klimach:~/CloneRep/Git-lesson$ git push origin bugfix/klimach | |
Username for 'https://github.com': klimach | |
Password for 'https://[email protected]': | |
Перечисление объектов: 5, готово. | |
Подсчет объектов: 100% (5/5), готово. | |
При сжатии изменений используется до 4 потоков | |
Сжатие объектов: 100% (2/2), готово. | |
Запись объектов: 100% (3/3), 292 bytes | 292.00 KiB/s, готово. | |
Всего 3 (изменения 1), повторно использовано 0 (изменения 0) | |
remote: Resolving deltas: 100% (1/1), completed with 1 local object. | |
remote: | |
remote: Create a pull request for 'bugfix/klimach' on GitHub by visiting: | |
remote: https://github.com/cursor-education/Git-lesson/pull/new/bugfix/klimach | |
remote: | |
To https://github.com/cursor-education/Git-lesson.git | |
* [new branch] bugfix/klimach -> bugfix/klimach | |
alexandr@klimach:~/CloneRep/Git-lesson$ | |
https://github.com/cursor-education/Git-lesson/pull/1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment