12 Commits
main ... merge

Author SHA1 Message Date
cd55ec501d 3.txt 3 string added 2022-01-04 22:01:29 +03:00
095f2f5e44 2.txt 3 string added 2022-01-04 22:01:09 +03:00
d77904647e Merge branches 'm2' and 'm3' into merge 2022-01-04 22:00:02 +03:00
ba6c62eddd 1.txt 3 string added 2022-01-04 21:59:33 +03:00
885abc1247 Merge branch 'm1' into merge 2022-01-04 21:58:26 +03:00
f3e17b3220 3.txt 2 string added 2022-01-04 21:56:13 +03:00
5d82e9f182 3.txt 1 string added 2022-01-04 21:55:51 +03:00
239ec92571 2.txt 2 string added 2022-01-04 21:55:22 +03:00
c3cc2840fc 2.txt 1 string added 2022-01-04 21:54:58 +03:00
38b1c674a0 1.txt 2 string added 2022-01-04 21:54:13 +03:00
334113dfe4 1.txt 1 string added 2022-01-04 21:53:45 +03:00
cc01201fc7 1.txt 2.txt 3.txt added 2022-01-04 21:47:20 +03:00
4 changed files with 9 additions and 49 deletions

3
1.txt Normal file
View File

@@ -0,0 +1,3 @@
1 string added
2 string added
3 string added

3
2.txt Normal file
View File

@@ -0,0 +1,3 @@
1 string added
2 string added
3 string added

3
3.txt Normal file
View File

@@ -0,0 +1,3 @@
1 string added
2 string added
3 string added

View File

@@ -1,49 +0,0 @@
For advanced git commands training
You can make any training in test branch
## git reset
To make a commit you need to do 3 steps:
1. Make changes
2. Add them to staging area
3. Make a commit
```
git reset --soft # resets #3 only
git reset (--mixed) # resets #3 and #2
git reset --hard # resets all #3, #2 and #1
```
---
## git rebase
```
git rebase <hash> # rebase using commits's hash
git rebase -i HEAD~n # interactive rebase for last n commits
git rebase -i --root HEAD # interactive rebase for all commits
```
---
## git commit referencing using ^ and ~
```
~n # follows straight history in one branch
^ = ^1 # first parent
^n # n parent
^^^2 # first parent/first parent/second parent
```
To practice referencing checkout "merge" branch and use some command to see what commints are referenced.
```
git log --oneline -1 HEAD~4
git log --oneline -1 HEAD~4^2^
etc...
```
---
## Commit Ranges
```
git log --oneline range2..range1 # use git log for showing what commits are selected (reverse order)
git cherry-pick --allow-empty (HEAD)..range1 # copy all commits from range1 branch into current that are already merged
git cherry-pick --allow-empty range1 ^range2 # copy all commits that are in range1 but not in range2
```