From 4c8d764121097ffa7fb8a0fde41e865ed8dcf2d4 Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Mon, 9 May 2022 15:23:43 +0300 Subject: [PATCH 1/8] git_ex1 --- 07_git_exercises/README | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 07_git_exercises/README diff --git a/07_git_exercises/README b/07_git_exercises/README new file mode 100644 index 00000000..e88d7afb --- /dev/null +++ b/07_git_exercises/README @@ -0,0 +1,4 @@ +1. create file +2. red +3.after git add (index ) - green color +4. red \ No newline at end of file From 187678d9e3af6f3f86e60072a61c77269aaaefbe Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Mon, 9 May 2022 15:29:54 +0300 Subject: [PATCH 2/8] git_ex1 --- 07_git_exercises/README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/07_git_exercises/README b/07_git_exercises/README index e88d7afb..f6020639 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -1,4 +1,5 @@ 1. create file 2. red 3.after git add (index ) - green color -4. red \ No newline at end of file +5. green +6.git diff main \ No newline at end of file From d4a77f131eb915afa41804cb31c6ac332d69216d Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Mon, 9 May 2022 17:11:46 +0300 Subject: [PATCH 3/8] git_ex1 --- 07_git_exercises/README | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/07_git_exercises/README b/07_git_exercises/README index f6020639..4570ba95 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -1,5 +1,11 @@ 1. create file 2. red 3.after git add (index ) - green color -5. green -6.git diff main \ No newline at end of file +# 4. writing git commit -m "add 1 to abc.txt file" +5.blue +6.git diff main +7. because i didn't stages files after last commit (cleen working tree) +8. stage2 is fail argument +10. doesn't print anything, because i didn't give an arguments wich give diff between stage or branch +11. git diff --cached +13. \ No newline at end of file From d89926d2899d9c77b9022f5488f688ebd1b5d32c Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Tue, 10 May 2022 11:15:43 +0300 Subject: [PATCH 4/8] git_ex1 --- 07_git_exercises/README | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/07_git_exercises/README b/07_git_exercises/README index 4570ba95..cd04a75a 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -4,8 +4,29 @@ # 4. writing git commit -m "add 1 to abc.txt file" 5.blue 6.git diff main -7. because i didn't stages files after last commit (cleen working tree) +7. because i didn't stages (git add "files") files after last commit 8. stage2 is fail argument -10. doesn't print anything, because i didn't give an arguments wich give diff between stage or branch +10. doesn't print anything, because git diff shows the difference in between the index and the working tree. 11. git diff --cached -13. \ No newline at end of file +13.no, git diff --staged --> only show changes to files in the "staged" area + git diff main ---> show all changes to tracked files + +14. first time we see abc.txt after commited (green) + second time we see abc.txt working tree (red) + +--------------------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 +* main + reset_question + + 2. From c673bbbdb552ac9a36c914cbe05e5d65c18a0a10 Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Tue, 10 May 2022 14:09:53 +0300 Subject: [PATCH 5/8] cherry-pick --- 07_git_exercises/README | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/07_git_exercises/README b/07_git_exercises/README index cd04a75a..12ee71b7 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -29,4 +29,7 @@ * main reset_question - 2. + 6. Yes - we have commits Marge branche + +--------------------------cherry-pick------------------- +4. (1) config.json (2) .env From 007a1bc171293cc472f48711ed44edb24b1f5c5a Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Wed, 11 May 2022 19:16:42 +0300 Subject: [PATCH 6/8] cherry-pick --- 07_git_exercises/README | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/07_git_exercises/README b/07_git_exercises/README index 12ee71b7..a28449be 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -33,3 +33,15 @@ --------------------------cherry-pick------------------- 4. (1) config.json (2) .env +5. yes, this is important because commits can be related to each other + +-----------------------Changes in working tree and switch branches------------- +3. git checkout problem - 1. Force checkout 2. Smart checkout 3. Don't checkout +5. No +6. No , remove my changes in indexing and working tree + +------------------------Reset----------------------- +2.1 remove the last commit from the current branch, but the file changes will stay in your working tree +2.2 remove the last commit from the current branch but still keep the changes in your working tree but not on the index +2.3 lose all uncommited changes and all untracked files +2.4 to go back a number of generations in HEAD~ 1,2,3,4 From e92e0d7fbfade02eff764476515aed2b9fdf5d93 Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Wed, 11 May 2022 20:32:15 +0300 Subject: [PATCH 7/8] cherry-pick --- 07_git_exercises/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07_git_exercises/README b/07_git_exercises/README index a28449be..fe1efb9e 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -44,4 +44,4 @@ 2.1 remove the last commit from the current branch, but the file changes will stay in your working tree 2.2 remove the last commit from the current branch but still keep the changes in your working tree but not on the index 2.3 lose all uncommited changes and all untracked files -2.4 to go back a number of generations in HEAD~ 1,2,3,4 +2.4 to go back a number of generations in HEAD~ (1,2,3,4) From b05a2e8259e177716ec9dd569bb2a5048c7e64cb Mon Sep 17 00:00:00 2001 From: alexeymihaylovdev Date: Sun, 15 May 2022 10:01:13 +0300 Subject: [PATCH 8/8] add Reset ex --- 07_git_exercises/README | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/07_git_exercises/README b/07_git_exercises/README index fe1efb9e..adca3a0b 100644 --- a/07_git_exercises/README +++ b/07_git_exercises/README @@ -29,7 +29,7 @@ * main reset_question - 6. Yes - we have commits Marge branche + 6. Yes - we have commits Marge branch --------------------------cherry-pick------------------- 4. (1) config.json (2) .env @@ -41,7 +41,11 @@ 6. No , remove my changes in indexing and working tree ------------------------Reset----------------------- -2.1 remove the last commit from the current branch, but the file changes will stay in your working tree -2.2 remove the last commit from the current branch but still keep the changes in your working tree but not on the index -2.3 lose all uncommited changes and all untracked files -2.4 to go back a number of generations in HEAD~ (1,2,3,4) +2.1 git reset --soft HEAD~1 - remove the last commit from the current branch, but the file changes will stay in your working tree +2.2 git reset --mixed HEAD~1 - remove the last commit from the current branch but still keep the changes in your working tree but not on the index +2.3 git reset --hard HEAD~1 - lose all uncommited changes and all untracked files + +2.4 git revert HEAD~1 - If you have already made your commits public, you will want to create a new commit which will "revert" the changes you made in "one" commits before HEAD. + +3. HEAD~1 means that you want to reset the HEAD (the last commit) to one commit before in the log history. +