Commit Ranges
This commit is contained in:
parent
33cc143bf2
commit
ae290204ed
12
README.md
12
README.md
@ -14,13 +14,13 @@ git reset --soft # resets #3 only
|
|||||||
git reset (--mixed) # resets #3 and #2
|
git reset (--mixed) # resets #3 and #2
|
||||||
git reset --hard # resets all #3, #2 and #1
|
git reset --hard # resets all #3, #2 and #1
|
||||||
```
|
```
|
||||||
***
|
---
|
||||||
## git rebase
|
## git rebase
|
||||||
```
|
```
|
||||||
git rebase <hash> # rebase using commits's hash
|
git rebase <hash> # rebase using commits's hash
|
||||||
git rebase -i HEAD~n # interactive rebase for last n commits
|
git rebase -i HEAD~n # interactive rebase for last n commits
|
||||||
```
|
```
|
||||||
***
|
---
|
||||||
## git commit referencing using ^ and ~
|
## git commit referencing using ^ and ~
|
||||||
```
|
```
|
||||||
~n # follows straight history in one branch
|
~n # follows straight history in one branch
|
||||||
@ -34,6 +34,14 @@ git log --oneline -1 HEAD~4
|
|||||||
git log --oneline -1 HEAD~4^2^
|
git log --oneline -1 HEAD~4^2^
|
||||||
etc...
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user