From e35f0346b6123f149bb98d5db1167aeecb635aa9 Mon Sep 17 00:00:00 2001 From: kostalubarsky Date: Wed, 18 May 2022 16:43:30 +0300 Subject: [PATCH 1/3] GIT EXE --- 07_git_exercises/kostalubarsky_ex1/README | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 07_git_exercises/kostalubarsky_ex1/README diff --git a/07_git_exercises/kostalubarsky_ex1/README b/07_git_exercises/kostalubarsky_ex1/README new file mode 100644 index 00000000..9c8d0dbe --- /dev/null +++ b/07_git_exercises/kostalubarsky_ex1/README @@ -0,0 +1,41 @@ +Git Basics (commit, diff, branches) +1. echo 1 > abc.txt +2. Red +3. git add abc.txt (blue color). git commit -m "commit to abc.txt file 1" +4. echo 2 >> abc.txt +5. Blue +6. git diff main +7. It's no git commit yet. +8. no branch named 'stage2'. +9. git add abc.txt +10.doesn't print anything +11. git diff --cached. Shows the changes between the index and the HEAD\main +12. echo 3 >> abc.txt +13. NO. _________________________________________________ +14. first after commit (green). second in the working tree (red) +15. + +Resolve conflicts +1. git branch + bugfix/fix_readme_typo + bugfix/open_kibana_port + dev + feature/data_retention_policy + feature/elasticsearch_helm_chart + feature/lambda_migration (my new branch) + feature/upgrade_angular_version + feature/version1 + feature/version2 +6. YES. + +Cherry picking +4. two files + a. config.json b. .env +5. YES _________________________________________________________ + +Changes in working tree and switch branches + + + + +Reset \ No newline at end of file From 0b1e6a70ada4c9b054c6ea7839d51daaa8b45cb6 Mon Sep 17 00:00:00 2001 From: kostalubarsky Date: Wed, 18 May 2022 16:48:37 +0300 Subject: [PATCH 2/3] GIT EXE --- 07_git_exercises/kostalubarsky_ex1/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07_git_exercises/kostalubarsky_ex1/README b/07_git_exercises/kostalubarsky_ex1/README index 9c8d0dbe..aa1625de 100644 --- a/07_git_exercises/kostalubarsky_ex1/README +++ b/07_git_exercises/kostalubarsky_ex1/README @@ -1,7 +1,7 @@ Git Basics (commit, diff, branches) 1. echo 1 > abc.txt 2. Red -3. git add abc.txt (blue color). git commit -m "commit to abc.txt file 1" +3. git add abc.txt (green color). git commit -m "add 1 to abc.txt commit" 4. echo 2 >> abc.txt 5. Blue 6. git diff main From 1c0783f6d63006d6d24446496327288c5ce8be50 Mon Sep 17 00:00:00 2001 From: kostalubarsky Date: Sun, 22 May 2022 11:58:40 +0300 Subject: [PATCH 3/3] GIT EXE --- 07_git_exercises/kostalubarsky_ex1/README | 25 +++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/07_git_exercises/kostalubarsky_ex1/README b/07_git_exercises/kostalubarsky_ex1/README index aa1625de..a5257bb9 100644 --- a/07_git_exercises/kostalubarsky_ex1/README +++ b/07_git_exercises/kostalubarsky_ex1/README @@ -11,9 +11,9 @@ Git Basics (commit, diff, branches) 10.doesn't print anything 11. git diff --cached. Shows the changes between the index and the HEAD\main 12. echo 3 >> abc.txt -13. NO. _________________________________________________ +13. NO. 14. first after commit (green). second in the working tree (red) -15. +15. git reset Resolve conflicts 1. git branch @@ -31,11 +31,28 @@ Resolve conflicts Cherry picking 4. two files a. config.json b. .env -5. YES _________________________________________________________ +5. YES . If we go back to older commit the new one will not be available. Changes in working tree and switch branches +2. echo take it > take.txt +3. git add take.txt +4. git checkout dev + error: Your local changes to the following files would be overwritten by checkout: + take.txt + Please commit your changes or stash them before you switch branches. + Aborting +5. No. There is "a b c" +6. git checkout feature/lambda_migration2 + no file take.txt. + Force Checkout overwrites uncommited changes -Reset \ No newline at end of file +Reset +2.1. git reset --soft HEAD~1 - Removes last commit and keeps changes on Index. +2.2. git reset --mixed HEAD~1 - Similar to 'soft' but doesn't keep chamges on Index. +2.3. git reset --hard HEAD~1 - Remove all uncomitted and untrackked files. +2.4. git revert HEAD~1 - Revert changes. + +3. HEAD~1 - Moving back in generations linear. \ No newline at end of file